range syntax

Roberto Bonvallet Roberto.Bonvallet at cern.ch
Fri Nov 10 11:25:45 EST 2006


Colin J. Williams wrote:
> One of the little irritants of Python is that the range syntax is rather 
> long-winded:
> [Dbg]>>> range(3, 20, 6)
> [3, 9, 15]
> [Dbg]>>>
> It would be nice if one could have something like 3:20:6.

In that case, how would the parser know which colon terminates the
'for' in the following example:

    for i in 2:3:4:
	...

-- 
Roberto Bonvallet



More information about the Python-list mailing list