PEP 234: Iterators

Marcin 'Qrczak' Kowalczyk qrczak at knm.org.pl
Mon May 7 13:46:37 EDT 2001


Mon, 7 May 2001 08:30:23 -0700, Neil Schemenauer <nas at python.ca> pisze:

>> 1, 3 ... 11 
>> 
>> is right way to specify the equivalent of 
>> 
>> range(1, 11+1, 3-1)
> 
> That doesn't seem very obvious to me.  It might be useful to
> look what Haskell does in this case.  I think they use [0..9] to
> mean the same thing as range(10).  I don't know what they do for
> non-contiguous ranges.

[1,3..11]

There are also [1..] and [1,3..] for infinite ranges (or ranges bound
by the upper bound of the given type).

-- 
 __("<  Marcin Kowalczyk * qrczak at knm.org.pl http://qrczak.ids.net.pl/
 \__/
  ^^                      SYGNATURA ZASTĘPCZA
QRCZAK



More information about the Python-list mailing list