You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
One of the more interesting ways to use print is printing output of a generator, as print(*generator()).
But if the generator generates a typeError, you get a very unhelpful error message:
>>> #the way it works OK
>>> deff(): yield'a'+'b'
...
>>> print(*f())
ab
>>> #Now with a type error
>>> deff(): yield'a'+5
...
>>> print(*f())
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: print() argument after * must be a sequence, not generator
The problem is twofold:
the message is plainly wrong, since it does work with a generator
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: