[Python-Dev] Extending types in C - help needed

Guido van Rossum guido@python.org
Thu, 17 Jan 2002 14:51:36 -0500


> Currently (after quite some time) I have the impression that you
> cannot create a subtype of PyType_Type in C because PyType_Type
> ends in a variable sized array, at least not in this way:
> 
> struct {
>     PyTypeObject type;
>     ...additional fields...
> } WrapperType_Type;
> 
> Can someone confirm this?

Yes, alas.  The type you would have to declare is 'etype', a private
type in typeobject.c.

--Guido van Rossum (home page: http://www.python.org/~guido/)