Is current integer for-loop syntax a wart?

Cromwell, Jeremy jcromwell at ciena.com
Fri Mar 8 13:26:00 EST 2002


PEP 276 (Simple Iterator for ints) and PEP 284 (Integer for-loops), among
others, are written from the perspective that the current integer for-loop
syntax

    for i in range(10):

is a wart.  Is this true?  That is, where does the Python community stand on
this issue?

If you will, please start your response by placing your description of the
syntax in one of these categories.

-Major wart
This is painful to type and I would support almost any type of improvement.

-Wart
I don't like the current syntax and would like to see an improvement, but I
could care less.

-Wart?
What's wrong with it?  I guess it could be improved but I never thought
about it.

-Not a wart
This is the most pythonic way to write an integer for loop.  I would oppose
almost any change.

Not to bias the results, but I'd be just as interested to hear from the
"Wart?" group as any other.

References
PEP 276, Simple Iterator for ints
http://www.python.org/peps/pep-0276.html
PEP 284, Integer for-loops
http://www.python.org/peps/pep-0284.html

-Jeremy Cromwell




More information about the Python-list mailing list