- Python 3 Object Oriented Programming
- Dusty Phillips
- 111字
- 2021-08-03 15:36:08
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 similar pieces of code or objects with similar functionality. In this chapter, we'll be covering the most famous object-oriented principle: inheritance. As discussed in Chapter 1, inheritance allows us to create "is a" relationships between two or more classes, abstracting common details into superclasses and storing specific ones 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
推薦閱讀
- MATLAB計算機視覺經(jīng)典應(yīng)用
- IBM Cognos 8 Report Studio Cookbook
- CAXA CAD電子圖板2020工程制圖
- Cinema 4D 2024+AI工具詳解與實戰(zhàn)(視頻微課·全彩版)
- 中文版Photoshop CS6平面設(shè)計實例教程(第2版)
- Premiere視頻編輯應(yīng)用教程:PremierePro 2020(微課版)
- 巧用ChatGPT高效搞定Excel數(shù)據(jù)分析
- Oracle BI Publisher 11g: A Practical Guide to Enterprise Reporting
- SOLIDWORKS 2023中文版機械設(shè)計從入門到精通
- 中文版Premiere Pro 2022基礎(chǔ)教程
- Photoshop 圖形圖像處理
- Photoshop移動UI設(shè)計
- Learning Website Development with Django
- Open Source Identity Management Patterns and Practices Using OpenAM 10.x
- Photoshop平面設(shè)計應(yīng)用教程:Photoshop 2020(第2版)