[Cython] inherit from list

Robin Becker robin at reportlab.com
Tue Apr 21 15:48:00 CEST 2009


I have some older code that used to run with pyrex without complaint, but now 
the following

cdef extern from "listobject.h":
	ctypedef class __builtin__.list [object PyListObject]:
		pass


causes a warning
> warning: C:\code\users\robin\_tex_wrap.pyx:144:1: list already a builtin Cython type


however, I cannot remove the above code as that causes an error at my class 
declaration



> cdef class ObjectList(list):


what's the correct cython way to inherit from a list or other builtin? I have 
looked in the extension_types section, but am no wiser.
--
Robin Becker


More information about the Cython-dev mailing list