[Python-ideas] Loop labels
anacrolix at gmail.com
Thu Mar 8 20:14:12 CET 2012
On Mar 9, 2012 3:04 AM, "Simon Sapin" <simon.sapin at kozea.fr> wrote:
> Le 08/03/2012 19:52, Matt Joiner a écrit :
>> Allow for and while statements to be labelled using "as".
> I like the idea. But regardless of whether it should be added at all, I
see one issue with the proposition in its current form.
> The with statement has a variable name after its own "as" keyword. Do
loop labels live in the same namespace as variables? Or can I have a
variable with the same name as a loop label without the two interfering?
The with statement is not a loop statement and would not be extended, so
this is not an issue.
It would be nonsensical to assign to loop labels, so I figure there would
be some non trivial checks done when a function is compiled. You raise an
> Simon Sapin
> Python-ideas mailing list
> Python-ideas at python.org
I neglected to mention that nested looping often requires a lot of
undesirable temporaries and additional state checks. Avoiding this a very
common goal, that can be circumvented with the aforementioned constructs.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Python-ideas