PEP 276 Simple Iterator for ints (fwd)

Luke LLoeffler at home.com
Tue Nov 27 21:25:01 CET 2001


Greg Ewing wrote:

> While trying to think of a range syntax that looks
> unambiguously half-open without clashing with list
> or tuple constructors, the following blindingly
> obvious solution occurred to me:
> 
>   for 0 <= i < 5:
>     ...


I'm new to Python (and admit I've only seen this message out of context 
of the whole thread as my news server is missing the rest--sorry if I'm 
repeating earlier sentiment), but feel that one of Python's best 
features is simplicity in syntax... It is so fast to type "for i in 
range(5):" because the tokens are just words.  This is much better than 
in Java or some other C like syntax where one must type for(int i=0; i < 
5; i++)... Where you have more symbols.  The former is easier to read 
because it is natural language and easier to type because your fingers 
stay where they are more comfortable--over letters.  I would rather not 
introduce a new symbolic looping construct, even if it was only 
optional... I've yet to find a case where range() or list comprehensions 
weren't good enough.

We all know about the coehesiveness and readibility of code from that 
other 'P' language that touts many ways to do something.

My $.02
L




More information about the Python-list mailing list