[Pyrex] Proposed change to behaviour of "not None"

Greg Ewing greg.ewing at canterbury.ac.nz
Fri Aug 22 01:13:40 CEST 2008


Robert Bradshaw wrote:

> I use the fact that extension types can be None all over the place.  Is 
> this exclusively for arguments?

Yes, it's only for arguments, and only for Python
functions (i.e. def, not cdef). The idea is to
protect the boundary between Python and C land
from getting passed invalid values.

Checking for None on all accesses is a separate
issue. I wouldn't object to an option for that,
although the cost of turning it on is going to
be very high, unless you can optimise some of
the tests away with flow analysis somehow.

-- 
Greg



More information about the Pyrex mailing list