8 Aug
2013
8 Aug
'13
6:13 p.m.
py.user added the comment: changed iter(arg) to *arg
import itertools
class A(itertools.chain): ... @classmethod ... def from_iter(cls, arg): ... return cls(*arg) ... class B(A): ... pass ... B('ab', 'cd') <__main__.B object at 0x7fc280e93cd0> b = B.from_iter(['ab', 'cd']) b <__main__.B object at 0x7fc280e93d20> next(b) 'a' next(b) 'b' next(b) 'c' next(b) 'd' next(b) Traceback (most recent call last): File "<stdin>", line 1, in <module> StopIteration
---------- _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue18301> _______________________________________