adalke at mindspring.com
Mon Aug 4 06:32:17 CEST 2003
> > true = (1 == 1)
> > false = not true
> > This was at the recommendation of someone on this list some time ago.
> There were no true booleans in 2.2 and earlier. Whoever recommended
> that didn't know what he was talking about. There was no difference.
Indeed, there were no true booleans in Python, but there were
actual PyTrue and PyFalse objects at the C level. Doing the "1 == 1"
trick would expose that implementation choice to Python.
This was rarely used. The only place I know of is in the win32 code,
where a COM API can take a boolean or an integer function. The
win32 interface checks if the value is PyTrue/PyFalse,
Here's relevant links
dalke at dalkescientific.com
More information about the Python-list