- Expert Python Programming(Second Edition)
- Micha? Jaworski Tarek Ziadé
- 220字
- 2021-07-16 10:58:07
Chapter 3. Syntax Best Practices – above the Class Level
We will now focus on syntax best practices for classes. It is not intended to cover design patterns here, as they will be discussed in Chapter 14, Useful Design Patterns. This chapter gives an overview of the advanced Python syntax to manipulate and enhance the class code.
Object model evolved greatly during history of Python 2. For a long time we lived in a world where two implementations of the object-oriented programming paradigm coexisted in the same language. These two models were simply referred to as old-style and new-style classes. Python 3 ended this dichotomy and only model known as new-style classes is available to the developers. Anyway, it is still important to know how both of them worked in Python 2 because it will help you in porting old code and writing backwards compatible applications. Knowing how the object model changed will also help you in understanding why it is designed that way right now. This is the reason why the following chapter will have a relatively large number of notes about old Python 2 features despite this book targets the latest Python 3 releases.
The following topics will be discussed in this chapter:
- Subclassing built-in types
- Accessing methods from super classes
- Using properties and slots
- Metaprogramming
- 計算思維與算法入門
- WildFly:New Features
- UML和模式應用(原書第3版)
- ReSharper Essentials
- SpringMVC+MyBatis快速開發與項目實戰
- Flink SQL與DataStream入門、進階與實戰
- Java從入門到精通(第5版)
- SEO智慧
- Java:Data Science Made Easy
- PLC編程及應用實戰
- Apex Design Patterns
- R語言數據可視化:科技圖表繪制
- Programming Microsoft Dynamics? NAV 2015
- 編程改變生活:用Python提升你的能力(進階篇·微課視頻版)
- Visual Basic程序設計全程指南