[Python-ideas] Special keyword denoting an infinite loop

Stefan Behnel stefan_ml at behnel.de
Sat Jun 28 12:05:43 CEST 2014


Steven D'Aprano, 28.06.2014 11:11:
> On Sat, Jun 28, 2014 at 01:04:24AM -0700, Thomas Allen wrote:
>> It won't cause any problems with existing programs,
>> because *loop* is very rarely used as a variable name.
> 
> How do you know it is rare? I've written code where loop is a name:
> 
> def main():
>     setup()
>     loop()

Also, this example only uses English names. There is no reason to assume
that programmers with other native languages that (also) use ASCII letters
or transliterations would not happen to have a word spelled "loop" in their
language that they may commonly use in their programs. Or that programmers
with a lower level of proficiency in the English language would also not
consider "loop" a good name for a variable or function. Or that there is no
technical/business/science/social/you-name-it terminology whatsoever that
makes "loop" appear as the most obvious choice for a name in a program of
that domain. "Obvious Reasoning" easily fails when it comes to
understanding naming decisions, especially across cultural boundaries.

Adding a new keyword needs very serious reasoning, and that's a good thing.

Stefan




More information about the Python-ideas mailing list