Issue 31071: *args unpacking can mask TypeErrors (original) (raw)
Python 3.6 makes it sound like maps aren't iterable:
map(str, *map(int, [[]])) Traceback (most recent call last): File "<pyshell#0>", line 1, in map(str, *map(int, [[]])) TypeError: type object argument after * must be an iterable, not map
More, including a likely explanation, in my question and its answer here: https://stackoverflow.com/q/45363330/1672429
Apparently the TypeError from int([]) gets mistaken for a TypeError indicating non-iterability of the map object.
Thanks for the report. Retitling because this has nothing to do with map:
def foo(*args): ... raise TypeError('fake') ... yield 1 ... foo(1, *foo()) Traceback (most recent call last): File "", line 1, in TypeError: foo() argument after * must be an iterable, not generator foo(*foo()) Traceback (most recent call last): File "", line 1, in File "", line 2, in foo TypeError: fake