[Pyrex] extending a builtin type

Greg Ewing greg.ewing at canterbury.ac.nz
Wed Nov 21 01:56:26 CET 2007


Robin Becker wrote:
> class ObjectList(list):
> 
> I'm wondering how I can convert this to pyrex?

You should be able to declare list as an external extension type
and then use it as a base class.

Something like

   cdef extern from "listobject.h":

     ctypedef class __builtin__.list [object PyListObject]:
         pass

   cdef class ObjectList(list):
     ...

--
Greg



More information about the Pyrex mailing list