On Dec 18, 2009, at 2:41 PM, mark florisson wrote:

> 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?

For the record, there is a ticket on this:

http://trac.cython.org/cython_trac/ticket/354

- Robert

_______________________________________________
Cython-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/cython-dev

Reply via email to