True

John Roth newsgroups at jhrothjr.com
Mon Aug 4 13:04:27 CEST 2003


"Andrew Dalke" <adalke at mindspring.com> wrote in message
news:bgknba$fk1$1 at slb0.atl.mindspring.net...
> Daniel Klein:
> > > true = (1 == 1)
> > > false = not true
> > >
> > > This was at the recommendation of someone on this list some time ago.
>
> John Roth
> > 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
> http://mail.python.org/pipermail/python-list/1999-November/015260.html
> http://mailman.pythonpros.com/pipermail/pycom-dev/1999q1/000106.html

So, are you saying that this would have returned -1, rather than 1?

John Roth

>                     Andrew
>                     dalke at dalkescientific.com
>
>






More information about the Python-list mailing list