Numbers and truth values
Alex Martelli
aleax at mac.com
Sat Apr 28 21:01:45 EDT 2007
Szabolcs <szhorvat at gmail.com> wrote:
> But I still think that it is an inconsistency to allow to redefine a
> _value_ like True or False (not a built-in function that may have been
> missing in earlier versions). Saying True = 2 is just like saying 3 = 2.
True and False were *ALSO* missing in earlier versions of Python (2.2.1
and back -- they were introduced in 2.2.2, smack in the middle of a
minor release cycle, a release engineering error which Guido has vowed
never to repeat).
There's a lot of code around that starts with
False = 0
True = not False
(or similar), so it can run just as well on (e.g) 2.2.1 (and earlier) as
2.2.2 (and later) -- breaking all of that code which always worked fine
is a decision not to be taken as lightly as you appear to imply.
Alex
More information about the Python-list
mailing list