[issue18301] In itertools.chain.from_iterable() there is no cls argument

py.user report at bugs.python.org
Thu Aug 8 19:45:26 CEST 2013


py.user added the comment:

>>> import itertools
>>> 
>>> class A(itertools.chain):
...     def from_iter(arg):
...         return A(iter(arg))
... 
>>> class B(A):
...     pass
... 
>>> B('a', 'b')
<__main__.B object at 0x7f40116d7730>
>>> B.from_iter(['a', 'b'])
<__main__.A object at 0x7f40116d7780>
>>>

it should be B

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue18301>
_______________________________________


More information about the Python-bugs-list mailing list