[Pyrex] Special Methods of Extension Types: inheritance

Greg Ewing greg.ewing at canterbury.ac.nz
Wed Aug 3 04:25:28 CEST 2005


Simon Burton wrote:

> 1) The special methods __new__ and __dealloc__ are chained to
 > the superclass (good)
> 
> 2) other methods ( __int__ and i'm not sure what else ) are not
 > inherited (why not?)

Generally I've tried to make things behave like their
Python counterparts as much as possible, which means
usually not calling superclass methods automatically.

I made special cases of __new__ and __dealloc__ for
reasons of safety and convenience. It never makes sense
not to call the inherited methods before/after these, and
very bad things would happen if it weren't automatic and
you forgot to do so.

> I think this should be noted in the docs somewhere.

I'll have a look and see if anything needs to be clarified.

Thanks for the comments,

-- 
Greg Ewing, Computer Science Dept, +--------------------------------------+
University of Canterbury,	   | A citizen of NewZealandCorp, a	  |
Christchurch, New Zealand	   | wholly-owned subsidiary of USA Inc.  |
greg.ewing at canterbury.ac.nz	   +--------------------------------------+



More information about the Pyrex mailing list