[New-bugs-announce] [issue11944] Function call with * and generator hide exception raised by generator.
Jeong-Min Lee
report at bugs.python.org
Thu Apr 28 03:00:47 CEST 2011
New submission from Jeong-Min Lee <falsetru at gmail.com>:
Expected "TypeError: cannot concatenate 'str' and 'int' objects" exception raised, but got following result.
>>> def g():
... '1' + 0
... yield 1, 2
... yield 3, 4
...
>>> zip(*g())
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: zip() argument after * must be a sequence, not generator
>>> (lambda xs: 0)(*g())
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: <lambda>() argument after * must be a sequence, not generator
>>> list(*g())
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: type object argument after * must be a sequence, not generator
>>> list(g())
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "<stdin>", line 2, in g
TypeError: cannot concatenate 'str' and 'int' objects
----------
components: Interpreter Core
messages: 134632
nosy: falsetru
priority: normal
severity: normal
status: open
title: Function call with * and generator hide exception raised by generator.
type: behavior
versions: Python 2.7, Python 3.3
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue11944>
_______________________________________
More information about the New-bugs-announce
mailing list