[Pyrex] extending a builtin type

Greg Ewing greg.ewing at canterbury.ac.nz
Thu Nov 22 01:26:32 CET 2007


Robin Becker wrote:
> I'm a bit unclear how 
> to carry out initialization for this case.

Pyrex will take care of calling the base class __new__
for you. If you want to initialise C attributes of your
own, write a __cinit__ method to do that.

Optionally you can write an __init__ that passes whatever
arguments you want to list.__init__, which is what will
determine the initial contents of the list.

-- 
Greg Ewing, Computer Science Dept, +--------------------------------------+
University of Canterbury,	   | Carpe post meridiem!          	  |
Christchurch, New Zealand	   | (I'm not a morning person.)          |
greg.ewing at canterbury.ac.nz	   +--------------------------------------+



More information about the Pyrex mailing list