diff options
author | Jim Fulton <jim@zope.com> | 2003-05-07 19:48:13 (GMT) |
---|---|---|
committer | Jim Fulton <jim@zope.com> | 2003-05-07 19:48:13 (GMT) |
commit | aed0a4a138c488b4731369f93fe434612647cfe7 (patch) | |
tree | edda5a6c4aecd48e77ea214a94b395b30c6de04a /Doc/inst | |
parent | a02469f9692cc5c1503dd35728c61789f4e8242f (diff) | |
download | cpython-aed0a4a138c488b4731369f93fe434612647cfe7.zip cpython-aed0a4a138c488b4731369f93fe434612647cfe7.tar.gz cpython-aed0a4a138c488b4731369f93fe434612647cfe7.tar.bz2 |
Rewrote the basic section of the chapter on defining new types.
Changed the example to show how to create types the new way:
- Use a class new method rather than a new function.
- Use self->ob_type->tp_free in deallocators
- Use attribute descriptors rather than set/getattr methods.
- Make the type usable as a base type.
I split the example into 3 parts:
1. The minimal new type
2. Adding attributes and methods.
3. Finer control over attributes.
It's much simpler to define builtin types. These updates hopefully
show this.
I also made minor wording changes in two other places.
I still need to update xxobject.c
Diffstat (limited to 'Doc/inst')
0 files changed, 0 insertions, 0 deletions