- 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
推薦閱讀
- Android Wearable Programming
- C++程序設(shè)計(jì)(第3版)
- 構(gòu)建移動(dòng)網(wǎng)站與APP:HTML 5移動(dòng)開發(fā)入門與實(shí)戰(zhàn)(跨平臺(tái)移動(dòng)開發(fā)叢書)
- Mastering Articulate Storyline
- OpenCV for Secret Agents
- C語(yǔ)言程序設(shè)計(jì)
- Building Mobile Applications Using Kendo UI Mobile and ASP.NET Web API
- Python爬蟲、數(shù)據(jù)分析與可視化:工具詳解與案例實(shí)戰(zhàn)
- Learning Node.js for .NET Developers
- 30天學(xué)通C#項(xiàng)目案例開發(fā)
- 物聯(lián)網(wǎng)系統(tǒng)架構(gòu)設(shè)計(jì)與邊緣計(jì)算(原書第2版)
- WildFly Cookbook
- Visual Basic程序設(shè)計(jì)實(shí)驗(yàn)指導(dǎo)及考試指南
- Spring Boot從入門到實(shí)戰(zhàn)
- Isomorphic Go