[Cython] special case Py_None at __Pyx_PyObject_IsTrue()

Robert Bradshaw robertwb at math.washington.edu
Fri Feb 6 22:47:18 CET 2009


On Feb 6, 2009, at 11:57 AM, Stefan Behnel wrote:

> Lisandro Dalcin wrote:
>> What do you think about this?
>
> Fine with me. None is a very common value and often used in boolean  
> checks like
>
>     if reference_that_may_be_None:
>         ...
>
> I bet the C compiler will even be able to figure out that such a  
> variable
> is None in some simple cases.

+1 from me too--so it will check for True, False, and None before  
deferring to the generic code then.

- Robert



More information about the Cython-dev mailing list