Loop until condition is true

Magnus Lycka lycka at carmen.se
Tue Jun 21 09:02:36 EDT 2005


Benji York wrote:
> If by "economy" you mean "optimization", then I would suggest that the 
> difference would be unnoticeable.

If there is a measurable performance gain in skipping the runtime
test in "while True", then this is a compiler issue, not a language
issue. 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?)

I hope the time is over when language designers build ugly quirks
into programming language syntaxes to make life a little easier for
the compilers.



More information about the Python-list mailing list