Re: New-style classes and special methods

2007-05-30 Thread Lenard Lindstrom
Raj B wrote: > > Yes, special methods populate the slots in the structures which Python > > uses to represent types. Objects/typeobject.c in the Python source > > distribution does the hard work, particularly in function type_new > > > > Thanks for that quick response. I am quite comfortable

Re: New-style classes and special methods

2007-05-30 Thread Alex Martelli
Raj B <[EMAIL PROTECTED]> wrote: > > Yes, special methods populate the slots in the structures which > Python > > uses to represent types. Objects/typeobject.c in the Python source > > distribution does the hard work, particularly in function type_new > > > > Thanks for that quick respons

Re: New-style classes and special methods

2007-05-30 Thread Raj B
> Yes, special methods populate the slots in the structures which Python > uses to represent types. Objects/typeobject.c in the Python source > distribution does the hard work, particularly in function type_new Thanks for that quick response. I am quite comfortable with C code and am try

Re: New-style classes and special methods

2007-05-30 Thread Alex Martelli
Raj B <[EMAIL PROTECTED]> wrote: > Hi > > My question is about how special methods are stored internally in > Python objects. > Consider a new-style class which implements special methods such as > __call__ and __new__ > > class C(type): > def __call__(...): > > > class

New-style classes and special methods

2007-05-30 Thread Raj B
Hi My question is about how special methods are stored internally in Python objects. Consider a new-style class which implements special methods such as __call__ and __new__ class C(type): def __call__(...): class B: __metaclass__ = C b= B() The ty