[Python-ideas] Break multiple loop levels

David Mertz mertz at gnosis.cx
Sun May 12 18:19:55 EDT 2019


On Sun, May 12, 2019, 5:36 PM Paul Moore <p.f.moore at gmail.com> wrote:

> On Sun, 12 May 2019 at 21:06, David Mertz <mertz at gnosis.cx> wrote:
> > I thought of 'as' initially, and it reads well as English. But it felt
> to me like the meaning was too different from the other meanings of 'as' in
> Python. I might be persuaded otherwise.
>
> If you think in terms of "named loops" rather than "labels", "as"
> makes a lot more sense.


Every name created with 'as' currently is a regular Python object, with a
memory address, and some methods, that can participate in comparison (at
least equality), that has a type, can be passed as a function argument,
etc. Actually, all that is true of EVERY name in Python other than keywords.

It seems like none of this would be true of a loop name/label. Hence my
first thought that a different way of introducing the word is more clear...
Maybe we can just prefix lines with labels instead, and add a 'goto'
command :-)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20190512/1326150c/attachment.html>


More information about the Python-ideas mailing list