Range Operation pre-PEP

Jeff Epler jepler at inetnebr.com
Sat May 12 21:51:26 EDT 2001


On Tue, 8 May 2001 11:44:20 +0400 (MSD), Roman Suzi
 <rnd at onego.ru> wrote:
>     Or in extended form to specify a step:
> 
>         >>> for i in (1, 3) .. 5:
>         ...     print i
>         1
>         3
>         5

I think this should yield
	(1,3)
	(2,4)
	(3,5)
	(4,)
	(5,)
or maybe
	(1,3)
	(2,4)
	(3,5)
	(4,5)
	(5,5)
or maybe
	(1,3)
	(2,4)
	(3,5)
	4
	5

Alternately, maybe
	>>> for i in (1, 3, 6) .. 19: print i
should yield
	1
	3
	6
	8
	11
	13
	16
	18
for obvious reasons.

Jeff



More information about the Python-list mailing list