预计阅读本页时间:-
Other Design-Related Topics
In this chapter, we’ve seen inheritance, composition, delegation, multiple inheritance, bound methods, and factories—all common patterns used to combine classes in Python programs. We’ve really only scratched the surface here in the design patterns domain, though. Elsewhere in this book you’ll find coverage of other design-related topics, such as:
广告:个人专属 VPN,独立 IP,无限流量,多机房切换,还可以屏蔽广告和恶意软件,每月最低仅 5 美元
- Abstract superclasses (Chapter 28)
- Decorators (Chapters 31 and 38)
- Type subclasses (Chapter 31)
- Static and class methods (Chapter 31)
- Managed attributes (Chapter 37)
- Metaclasses (Chapters 31 and 39)
For more details on design patterns, though, we’ll delegate to other resources on OOP at large. Although patterns are important in OOP work, and are often more natural in Python than other languages, they are not specific to Python itself.