[issue4806] Function calls taking a generator as star argument can mask TypeErrors in the generator

Hagen Fürstenau report at bugs.python.org
Wed Jun 3 11:13:43 CEST 2009


Hagen Fürstenau <hfuerstenau at gmx.net> added the comment:

I added a simple check for iterables. This is not very elegant, but
performance is only affected in the case of an exception. Patch and
corresponsing test are attached as "TypeError.patch".

As I pointed out above, the actual error message "must be a sequence" is
also inconsistent with the implementation (and tests) which allows any
kind of iterable. The attached and independent patch
"message_and_docs.patch" changes this to "must be an iterable" and
corrects docs and tests accordingly.

----------
keywords: +patch
versions: +Python 2.7, Python 3.1
Added file: http://bugs.python.org/file14166/TypeError.patch

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


More information about the Python-bugs-list mailing list