[Python-ideas] "while:" for the loop

David Mertz mertz at gnosis.cx
Wed Sep 26 12:29:48 EDT 2018


We also have:

from itertools import count
for i in count():
    ...

If you want to keep track of how close to infinity you are. :-)

On Wed, Sep 26, 2018, 12:24 PM Michael Selik <mike at selik.org> wrote:

> On Wed, Sep 26, 2018, 9:42 AM Tobias Kohn <kohnt at tobiaskohn.ch> wrote:
>
>> Although I doubt it will really make it into Python's grammar, I am all
>> +1 for the idea of having "repeat" as a loop keyword in Python.
>> Actually, I have been using "repeat" as a keyword in Python for quite some
>> time now, and found it not only convenient, but also a great help in
>> education.
>>
> Guido has repeatedly (haha) rejected this proposal [0]. He has written
> that he considered it, but decided that in practical code one almost always
> loops over data, and does not want an arbitrary number of iterations. The
> range object solves this problem.
>
> You might notice that a repeat keyword appears in many graphics-focused
> child education languages, but not many "serious" languages.
>
> [0] I remember at least two times, but can't find them with search at the
> moment.
>
>> _______________________________________________
> Python-ideas mailing list
> Python-ideas at python.org
> https://mail.python.org/mailman/listinfo/python-ideas
> Code of Conduct: http://python.org/psf/codeofconduct/
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20180926/60e07367/attachment.html>


More information about the Python-ideas mailing list