[Python-Dev] flextype.c -- extended type system

Brett Cannon drifty@bigfoot.com
Sat, 14 Sep 2002 22:49:00 -0700 (PDT)


[Christian Tismer]

> Hi Guido, py-dev,
>
> preface:
> --------
> a week ago or so, I sent a patch to Guido that removes
> the "etype" struct. This is a hidden structure that
> extends types when they are allocated on the heap.
> One restriction with this type was that types could
> not be extended by metatypes for some internal reason.
> I fixed this. Now meta-types can define extra slots
> for types.
>

I have never written a type or object in C, so bear with my newbie
questions.  Are you saying, Chris, that before you could not inherit a
type written in C and override a method?  Is this only in regards to the
magic method slots or just any method?

>From what I gather in your email, it seems like you came up with proper
overriding inheritence in C for methods defined in a type.  So does this
means you can now override the __contains__ magic slot in C code through
some inherited type and this was not doable before?  Perhaps an example of
something from the Python core that was not possible before would solidify
this for me.

-Brett