[Pyrex] Cannot cdef __init__?
Paul Prescod
paul.prescod at blastradius.com
Mon Jan 19 22:55:54 CET 2004
> -----Original Message-----
> From: Andrew Bennetts [mailto:andrew-pyrex at puzzling.org]
> Sent: Monday, January 19, 2004 4:43 AM
> To: Simon Burton
> Cc: pyrex at lists0.copyleft.no
> Subject: Re: [Pyrex] Cannot cdef __init__?
>
> ...
>
> Ok, I'll see how I go. The Pyrex source looks fairly clean,
> so hopefully I
> can figure out how to do it. No guarantees on how long it
> will take me,
> though :)
Let me give you a quick hint. __init__ methods usually end up in the tp_init
slot of a PyTypeObject (do a search for __init__ in Pyrex output). That slot
has a fixed signature. You can't change it. So your cdef __init__ stuff has
to go somewhere else. I'm not sure what you'll put in the tp_init ...
perhaps a method that just throws a TypeError exception or something?
Paul Prescod
More information about the Pyrex
mailing list