New submission from Sergey Fedoseev <fedoseev.ser...@gmail.com>:

zip() shadows TypeError raised in __iter__() of source iterable:

In [21]: class Iterable:
    ...:     def __init__(self, n):
    ...:         self.n = n
    ...:     def __iter__(self):
    ...:         return iter(range(self.n))
    ...:     

In [22]: zip(Iterable('one'))
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-22-66835be83afa> in <module>()
----> 1 zip(Iterable('one'))

TypeError: zip argument #1 must support iteration

----------
messages: 350763
nosy: sir-sigurd
priority: normal
severity: normal
status: open
title: zip() shadows TypeError raised in __iter__() of source iterable

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue37976>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to