On Jan 26, 12:08 pm, Terry Reedy wrote:
> Fuzzyman wrote:
> > On Jan 25, 2:28 pm, Alan G Isaac wrote:
> >> On 1/16/2009 3:13 PM Alan G Isaac apparently wrote:
> >> > It is documented:
> >> >http://docs.python.org/3.0/library/stdtypes.html#sequence-types-str-b...
>
> >> But then again, the oppos
Fuzzyman wrote:
On Jan 25, 2:28 pm, Alan G Isaac wrote:
On 1/16/2009 3:13 PM Alan G Isaac apparently wrote:
> It is documented:
>http://docs.python.org/3.0/library/stdtypes.html#sequence-types-str-b...
But then again, the opposite is also documented,
since `range` is a sequence type. Quotin
On Jan 25, 2:28 pm, Alan G Isaac wrote:
> On 1/16/2009 3:13 PM Alan G Isaac apparently wrote:
> > It is documented:
> >http://docs.python.org/3.0/library/stdtypes.html#sequence-types-str-b...
>
> But then again, the opposite is also documented,
> since `range` is a sequence type. Quoting:
>
>
On 1/16/2009 3:13 PM Alan G Isaac apparently wrote:
> It is documented:
>
http://docs.python.org/3.0/library/stdtypes.html#sequence-types-str-bytes-bytearray-list-tuple-range
But then again, the opposite is also documented,
since `range` is a sequence type. Quoting:
Sequences also support
It is documented:
http://docs.python.org/3.0/library/stdtypes.html#sequence-types-str-bytes-bytearray-list-tuple-range
--
http://mail.python.org/mailman/listinfo/python-list
Alan G Isaac schrieb:
> On 1/16/2009 1:15 PM Paul Rubin apparently wrote:
>> range is an iterator now. Try itertools.islice.
>
> Well yes, it behaves like xrange did.
> But (also like xrange) it supports indexing. (!)
> So why not slicing?
> I expected this (to keep it functionally
> more similar
On 1/16/2009 1:15 PM Paul Rubin apparently wrote:
range is an iterator now. Try itertools.islice.
Well yes, it behaves like xrange did.
But (also like xrange) it supports indexing. (!)
So why not slicing?
I expected this (to keep it functionally
more similar to the old range).
Alan Isaac
--
h
Alan G Isaac writes:
> >>> x = range(20)
> >>> s = slice(None,None,2)
> >>> x[s]
> Traceback (most recent call last):
>File "", line 1, in
> TypeError: sequence index must be integer, not 'slice'
range is an iterator now. Try itertools.islice.
--
http://mail.python.org/mailman/listinfo/p
On Jan 16, 5:45 pm, Alan G Isaac wrote:
> Is the behavior below expected? Documented?
> (The error msg is misleading.)
> Thanks,
> Alan Isaac
>
> >>> x = range(20)
> >>> s = slice(None,None,2)
> >>> x[s]
> Traceback (most recent call last):
> File "", line 1, in
> TypeError: sequence index