[Python-ideas] Consider making enumerate a sequence if its argument is a sequence

Alexander Belopolsky alexander.belopolsky at gmail.com
Wed Sep 30 19:15:46 CEST 2015


On Wed, Sep 30, 2015 at 12:53 PM, Neil Girdhar <mistersheik at gmail.com>
wrote:

> A Sequence is an Iterator.


No, a Sequence is an Iterable, not an Iterator:

>>> issubclass(collections.Sequence, collections.Iterator)
False
>>> issubclass(collections.Sequence, collections.Iterable)
True
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20150930/b2ffcbe2/attachment.html>


More information about the Python-ideas mailing list