- 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
推薦閱讀
- ASP.NET Web API:Build RESTful web applications and services on the .NET framework
- Learning Real-time Processing with Spark Streaming
- Learning Apex Programming
- Python數(shù)據(jù)可視化:基于Bokeh的可視化繪圖
- SQL學(xué)習(xí)指南(第3版)
- 青少年美育趣味課堂:XMind思維導(dǎo)圖制作
- Elasticsearch Server(Third Edition)
- Python編程實(shí)戰(zhàn)
- Android開(kāi)發(fā)案例教程與項(xiàng)目實(shí)戰(zhàn)(在線實(shí)驗(yàn)+在線自測(cè))
- Mastering JavaScript Design Patterns(Second Edition)
- 青少年信息學(xué)競(jìng)賽
- Mastering openFrameworks:Creative Coding Demystified
- 移動(dòng)增值應(yīng)用開(kāi)發(fā)技術(shù)導(dǎo)論
- Hadoop大數(shù)據(jù)分析技術(shù)
- Mastering Elixir