[Python-Dev] RE: PEP 285: Adding a bool type

Emile van Sebille emile at fenx.com
Sat Mar 30 11:33:52 EST 2002


[is this an April fool's joke?  I hate it when I get caught in one of
these!  Here's my reply anyway, just in case...]

-1*0

With my memory not reaching as far back as others, I thought I'd look
into prior discussions on this.  I started at
http://groups.google.com/groups?q=boolean+type+%22not+not%22+group:comp.
lang.python
expecting that the conjunction of asking about 'boolean' and 'type',
with the expected reply to use the pydiom 'not not' would land me right
in the thick of things.

I got a single page.  There isn't a history of need here.  I then
scanned the 2.2 standard library (thinking of it as the standard bearer
for python code) for true/false usage, as Guido cited standardization of
usage as a primary objective.  I found a _false, a reference in
ConfigParser to states, and a Boolean class in xmlrpclib.  Anyone can
today import boolean, True and False from xlmrpclib and have this
functionality and standardization.  Enforcing it's use, in light of the
backwards-compatibility allowances included in the PEP, is no different
than enforcing the use of True or False in code as long as 0 and 1
suffice.

On the down side, this PEP breaks code by changing the outcome of
virtually *all* comparisons.  Hopefully in non-code-breaking fashion.
And that the change is restricted to the 28 identified built-ins.  And
that the mods to them do not introduce bugs or unforeseen
incompatibilities.  Tall order for what had been expected to be a
clean-up release.

--

Emile van Sebille
emile at fenx.com

---------




More information about the Python-list mailing list