On Mar 27, 2009, at 9:16 AM, Stefan Behnel wrote: > Jørgen P. Tjernø wrote: >> Jason Evans wrote: >>> Jørgen P. Tjernø wrote: >>>> This code, specifically the list comprehension, generates C code >>>> that >>>> gives me: >>>> warning: implicit declaration of function ‘PyBool_CheckExact’ > > That's a known bug in 0.10.3. It's fixed in 0.11. > > >>> Use 'bint' instead of 'bool'. (I've also tripped on this at >>> various times.) >> Ah, thanks a lot. That fixes it nicely! > > That's the right thing to do anyway. "bint" is a C type, "bool" is > a Python > type.
To be more specific, bool is a C++ type, but has different semantics than bint. In Cython, bint is a c int (and may have several distinct values, e.g. <bint>2 != <bint>1. The only difference is that the conversion routines from Python objects go via PyObject_IsTrue and it becomes True and False when going to a Python object. - Robert _______________________________________________ Cython-dev mailing list [email protected] http://codespeak.net/mailman/listinfo/cython-dev
