Quellcode-Paket python-extclass herunterladen:
A lightweight mechanism, named "ExtensionClass", has been developed for making Python extension types more class-like. Classes can be developed in an extension language, such as C or C++, and these classes can be treated like other Python classes:
- They can be sub-classed in Python, - They provide access to method documentation strings, and - They can be used to directly create new instances.
An example class shows how extension classes are implemented and how they differ from extension types.
Extension classes provide additional extensions to class and instance semantics, including:
- A protocol for accessing subobjects "in the context of" their containers. This is used to implement custom method types and environmental acquisition. - A protocol for overriding method call semantics. This is used to implement "synchronized" classes and could be used to implement argument type checking. - A protocol for class initialization that supports execution of a special '__class_init__' method after a class has been initialized.
Extension classes illustrate how the Python class mechanism can be extended and may provide a basis for improved or specialized class models.
|
|
|
| Architektur | Paketgröße | Größe (installiert) | Dateien |
|---|---|---|---|
| alpha | 108,7 kB | 432 kB | [Liste der Dateien] |
| amd64 | 106,6 kB | 404 kB | [Liste der Dateien] |
| armel | 96,8 kB | 372 kB | [Liste der Dateien] |
| avr32 (inoffizielle Portierung) | 94,3 kB | 332 kB | [Liste der Dateien] |
| hppa | 111,9 kB | 424 kB | [Liste der Dateien] |
| hurd-i386 | 93,1 kB | 360 kB | [Liste der Dateien] |
| i386 | 94,6 kB | 316 kB | [Liste der Dateien] |
| ia64 | 125,9 kB | 560 kB | [Liste der Dateien] |
| kfreebsd-amd64 | 104,7 kB | 330 kB | [Liste der Dateien] |
| kfreebsd-i386 | 95,0 kB | 294 kB | [Liste der Dateien] |
| m68k (inoffizielle Portierung) | 99,8 kB | 376 kB | [Liste der Dateien] |
| mips | 98,5 kB | 412 kB | [Liste der Dateien] |
| mipsel | 95,7 kB | 412 kB | [Liste der Dateien] |
| powerpc | 113,0 kB | 452 kB | [Liste der Dateien] |
| s390 | 102,7 kB | 396 kB | [Liste der Dateien] |
| sparc | 100,3 kB | 384 kB | [Liste der Dateien] |