New User Question: extension types and python 2.2/class/type

Martin von Loewis loewis at
Thu Jul 26 04:07:26 EDT 2001

thomas_barket at (tom barket) writes:

> Having followed the class/type unification discussions somewhat and
> read Guido's "Unifying types and classes in python 2.2" tutorial, it
> seems to me that chapter 2 "Defining New Types" in the "Extending
> and Embedding the Python Interpreter" doc is about to become
> obsolete (in the sense that what it describes will shortly *not* be
> the prefered way to define/import new types).

Not at all. PyType objects won't go away. Instead, additional slots
are added, to accomodate the extensibility.

> Since this was going to be my guide for my own extension type
> endeavor, I would like to ask how can i get instructions for
> correctly writing an "extension type" under the new (or actually
> soon-to-be-new) regime.

I'd recommend to define the type using the current API; the additional
API is not completely documented yet. Furthermore, you will only ever
need it if you want to inherit Python classes from your type.


More information about the Python-list mailing list