[issue32259] Misleading "not iterable" Error Message when generator return a "simple" type, and a tuple is expected

Terry J. Reedy report at bugs.python.org
Mon Dec 18 15:50:41 EST 2017


Terry J. Reedy <tjreedy at udel.edu> added the comment:

In English, 'adjective noun' does not necessarily imply the existence of 'not-adjective' nouns, and the adjective may serve as a reminder or reason.  For instance, "This job is too dangerous for mortal humans!"

In the current context, failure of 'iter(ob)', by itself, only tells us that the particular object ob is not iterable. "'X' object is not iterable", rather that "'X' objects are not iterable", is correct.  (Ditto for other messages.)

That said, I think "cannot unpack int object, because not iterable" is better.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue32259>
_______________________________________


More information about the Python-bugs-list mailing list