- Python 3 Object:oriented Programming(Second Edition)
- Dusty Phillips
- 114字
- 2021-07-16 20:44:32
Chapter 3. When Objects Are Alike
In the programming world, duplicate code is considered evil. We should not have multiple copies of the same, or similar, code in different places.
There are many ways to merge pieces of code or objects that have a similar functionality. In this chapter, we'll be covering the most famous object-oriented principle: inheritance. As discussed in Chapter 1, Object-oriented Design, inheritance allows us to create is a relationships between two or more classes, abstracting common logic into superclasses and managing specific details in the subclass. In particular, we'll be covering the Python syntax and principles for:
- Basic inheritance
- Inheriting from built-ins
- Multiple inheritance
- Polymorphism and duck typing
推薦閱讀
- ClickHouse性能之巔:從架構(gòu)設(shè)計(jì)解讀性能之謎
- Java Web開(kāi)發(fā)學(xué)習(xí)手冊(cè)
- Software Defined Networking with OpenFlow
- Mastering JavaScript Object-Oriented Programming
- JavaScript高效圖形編程
- 算法零基礎(chǔ)一本通(Python版)
- Mastering SVG
- PaaS程序設(shè)計(jì)
- Java加密與解密的藝術(shù)(第2版)
- C語(yǔ)言程序設(shè)計(jì)
- 3D少兒游戲編程(原書(shū)第2版)
- 編程可以很簡(jiǎn)單
- App Inventor少兒趣味編程動(dòng)手做
- Java 從入門(mén)到項(xiàng)目實(shí)踐(超值版)
- PHP+MySQL Web應(yīng)用開(kāi)發(fā)教程