no side effects

Michele Simionato mis6 at pitt.edu
Wed Jan 8 21:31:06 CET 2003


"Martin v. Löwis" <martin at v.loewis.de> wrote in message news:<avhbmr$7ib$06$1 at news.t-online.com>...
> More relevant is that each for loop introduces a hidden variable. This 
> hidden variable used to be an index into the sequence iterated over, and 
> now is an iterator object which draws the next element from the sequence.

I didn't know it was an iterator. Anyway, it is a smart one, since it
can go in the two senses,

>>> range(10,0,-2)
[10, 8, 6, 4, 2]

Thanks,

               Michele




More information about the Python-list mailing list