Python 3: range objects cannot be sliced
tjreedy at udel.edu
Mon Jan 26 02:08:15 CET 2009
> On Jan 25, 2:28 pm, Alan G Isaac <alan.is... at gmail.com> wrote:
>> On 1/16/2009 3:13 PM Alan G Isaac apparently wrote:
>> > It is documented:
>> But then again, the opposite is also documented,
>> since `range` is a sequence type. Quoting:
>> Sequences also support slicing ...
>> Some sequences also support “extended slicing”
>> Is this a documentation bug, or a bug in `range`?
>> (I'd think the latter.)
No range slicing is intended.
> Where does the documentation say that range objects are sequences?
> They're iterables.
Range objects (2.x xrange objects) were more sequence-like in 2.x. 3.0
doc still says "There are five sequence types: strings, byte sequences,
byte arrays, lists, tuples, and range objects" (the miscount has already
I added a note to
suggesting that ranges be removed from the sequence section.
I made several other suggestions for improving this sections.
Supportive comments might help get action.
More information about the Python-list