[Python-ideas] Consider making enumerate a sequence if its argument is a sequence
mistersheik at gmail.com
Wed Sep 30 19:18:44 CEST 2015
Ah good point. Well, in the case of a sequence argument, an enumerate
object could be both a sequence and an iterator.
On Wed, Sep 30, 2015 at 1:15 PM Alexander Belopolsky <
alexander.belopolsky at gmail.com> wrote:
> On Wed, Sep 30, 2015 at 12:53 PM, Neil Girdhar <mistersheik at gmail.com>
>> A Sequence is an Iterator.
> No, a Sequence is an Iterable, not an Iterator:
> >>> issubclass(collections.Sequence, collections.Iterator)
> >>> issubclass(collections.Sequence, collections.Iterable)
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Python-ideas