[Bf-python] boolean check bug in Armature_setDrawAxes

Stephen Swaney sswaney at centurytel.net
Fri Dec 23 18:05:03 CET 2005


On Fri, Dec 23, 2005 at 10:45:15AM -0500, Gilbert, Joseph T. wrote:
> 
> Couple things:
> 1.There have been a number of ways to parse Boolean values in the api
> and I think this is something else that needs overhaul for the 2.40 api.
> Lets add this to the wiki.
> 2. PyObject_IsTrue evaluates any positive integer as true. It is equally
> valid using PyObject_IsTrue to write Armature.drawAxes = 500. Therefore
> I don't see it as 'wrong' that the user pass True/False to a Boolean
> method and not an integer.

You are missing the point here.  The code as written checks only for a
Boolean object.

In Python, a whole slew of things evaluate as True; basically anything
that is not False, None, zero or null.  Look at the source for the
PyObject_IsTrue method to see examples.

-- 
Stephen Swaney			
sswaney at centurytel.net




More information about the Bf-python mailing list