Python 3: range objects cannot be sliced

Fuzzyman fuzzyman at gmail.com
Sun Jan 25 19:20:47 EST 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:
>  >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:
>
>      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.)
>
> Cheers,
> Alan Isaac

Where does the documentation say that range objects are sequences?
They're iterables.

Michael Foord
--
http://www.ironpythoninaction.com/



More information about the Python-list mailing list