from : https://www.python.org/doc/newstyle/
New-style Classes
Unfortunately(遗憾,不幸的), new-style classes have not yet been integrated(集成) into Python‘s standard documention. Fear(担心) not, however; many people have worked to provide useful information on creating and using new-style classes:
- Unifying types and classes (aka descrintro) is Guido‘s essay(文章) on new-style classes and should be your starting point(起点).
- Raymond Hettinger‘s How-To Guide for Descriptors focuses on the single most useful aspect(方面) of new-style classes (which includes properties(属性)).
- Python 2.3 Method Resolution Order (MRO) covers(涵盖了) multiple inheritance(继承).
- Metaclasses will make your head explode(头大). Here are several(几个) approaches(方法) to discussing them:
- David Mertz and Michele Simionato‘s DeveloperWorks article
- Mike Fletcher‘s slideshow
- Metaclasses in Five Minutes
- Types and Objects is the start of a new-style class tutorial with lots of figures(数据) and examples, but it‘s rough(粗略的) and not complete(不完整的).
时间: 2024-11-14 11:05:55