[Cython] Bug in NULL handling introduced 0.14.1-1

Greg Ewing greg.ewing at canterbury.ac.nz
Mon Feb 14 07:49:42 CET 2011

Chris Colbert wrote:
> The problem with delattr (and thus PyObject_DelAttr) arises when you 
> define a __delattr__ method on your class. There is not easy way to then 
> call back into the "normal" python delattr semantics, except by doing 
> object.__delattr__ (which is not optimized by Cython). 

Hmmm, perhaps it should be? And similarly for all the other type

> I would argue that there should be at least some way to pass a NULL 
> pointer in Cython where a PyObject* is expected.

The trouble is that supporting this in general both safely and
efficiently would require keeping track of which object references
are allowed to be NULL. Could be done, but might require quite a
lot of work.

Maybe something more limited could be done such as allowing
a literal NULL to be passed to a function argument that is
specially marked as permitting this.


More information about the cython-devel mailing list