Loop until condition is true
Mike Meyer
mwm at mired.org
Thu Jun 23 15:21:11 EDT 2005
Michael Hoffman <cam.ac.uk at mh391.invalid> writes:
> Mike Meyer wrote:
>
>> Making None a constant broke existing code (and I just saw old code
>> that assigned to None). Are True and False that much more common as
>> variable names than None?
>
> Yes. In fact, I count at least 4 different modules in the Python 2.4
> standard library that assign to True or False, mainly as a
> compatibility measure for the days before they were built-ins. If you
> try assigning None, CPython will refuse to compile the module, even if
> the code where None is assigned is unreachable.
>
> If there was ever a good reason to assign to None, I don't know it.
For the record, the code I just saw did something like this:
(var1, var2, None, None) = make_tuple(args)
Pretty clearly, they were just throwing away some unused values. Who
knows what it did to None...
<mike
--
Mike Meyer <mwm at mired.org> http://www.mired.org/home/mwm/
Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information.
More information about the Python-list
mailing list