On Wed, Sep 30, 2015 at 10:33 AM, Serhiy Storchaka email@example.com wrote:
On 30.09.15 20:18, Neil Girdhar wrote:
Ah good point. Well, in the case of a sequence argument, an enumerate object could be both a sequence and an iterator.
It can't be.
x = 'abcd' list(zip(x, x))
[('a', 'a'), ('b', 'b'), ('c', 'c'), ('d', 'd')]
x = iter('abcd') list(zip(x, x))
[('a', 'b'), ('c', 'd')]
well, that's because zip is using the same iterator it two places. would that ever be the case with enumerate?
Python-ideas mailing list Pythonfirstname.lastname@example.org https://mail.python.org/mailman/listinfo/python-ideas Code of Conduct: http://python.org/psf/codeofconduct/