Hello, Currently, bint Cython types get converted to int Python objects when accessed in Python code as attributes of an object, and I think it would be more consistent and logical to have it return actual bool objects (for instance if you return a bint from a function or method it gets converted to a bool). So instead of storing a bint as an int, it could be stored as a char, and the T_BOOL macro name could be used in the PyMemberDef to have it automatically converted to True/False. I have included a patch that does this, but this obviously causes overflows for code that assigns values that don't fit in a char. I'm not sure if that's an issue, if it is, could we perhaps generate get/set methods that return a bool object when accessed from python code?
Cheers, Mark
bint_patch
Description: Binary data
_______________________________________________ Cython-dev mailing list [email protected] http://codespeak.net/mailman/listinfo/cython-dev
