PEP 276 Simple Iterator for ints (fwd)

gbreed at cix.compulink.co.uk gbreed at cix.compulink.co.uk
Thu Nov 15 09:31:52 EST 2001


Paul Rubin wrote:

> 0..5 = 0,1,2,3,4 would be awful.  Better would be introduce a new
> function, say maxindex(sequence), equal to len(sequence)-1.  Then
> you'd say 
> 
>    for i in 0..maxindex(sequence):

If you're going to define a new function, how about

   for i in indices(sequence):

or somesuch?


                Graham



More information about the Python-list mailing list