[Pyrex] cdef __init__

Greg Ewing greg.ewing at canterbury.ac.nz
Mon Mar 26 23:13:28 UTC 2007


Sam Rushing wrote:
> I've just noticed that if your extension class has PyObject slots in it,
> then the new constructor will fail.

Yeah, that's another reason it's not a good idea
to bypass __new__.

You also need to be careful what you do if your
class inherits from something else. If it's not
a Pyrex-defined class, you really have no option
but to call its __new__ method to create it,
since you have no way of finding out all the
things that need to be done to initialise it
properly.

--
Greg



More information about the Pyrex mailing list