Loop until condition is true
Stelios Xanthakis
sxanth at ceid.upatras.gr
Tue Jun 21 11:21:50 EDT 2005
Magnus Lycka wrote:
> Konstantin Veretennicov wrote:
>
>> On 6/21/05, Magnus Lycka <lycka at carmen.se> wrote:
>>
>>> I don't know anything about the Python compiler internals,
>>> but it doesn't seem very hard to identify simple literals following
>>> while and if, and to skip the runtime test. (Perhaps it's done
>>> already?)
>>
>>
>>
>> True doesn't seem to be a literal, it is looked up by name and can be
>> rebound to, say, 0 anytime:
>
>
> Right. Silly me. Maybe in some future Python version, True and False
> will be constants, like None is since Python 2.4.
Actually, there is support in marshal to write True and False objects so
I don't understand why this isn't in 2.4
Anyway, if you can't wait for 2.5 either use 'while 1:', or pyc[1]
Stelios
[1] http://students.ceid.upatras.gr/~sxanth/pyc/
More information about the Python-list
mailing list