This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author wiggin15
Recipients martin.panter, skip.montanaro, steven.daprano, ulaganathanm123@gmail.com, wiggin15, worr
Date 2015-04-15.15:27:14
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1429111634.8.0.550110783124.issue23949@psf.upfronthosting.co.za>
In-reply-to
Content
I couldn't find a way to add 'got %d' to the 'too many values' message. This would either require going over the rest of the iterator (which will take more time and may never return) or trying to figure out if it has a 'len' member. I didn't find any place in the current code that does something like this and writing one myself is too error prone (there are so many cases...). PyObject_Size returns an error if I try to use it for this purpose.

I found another message with "need more than ..." that I improved in the same way. This message is for when trying to execute:
  >>> a, *(b, c, d) = 1, (2, 3), (4, 5)
Now it outputs the message for the star unpacking:
  ValueError: not enough values to unpack (expected 3, got 2)
which is confusing in this use case but still better than before. Oh my!
History
Date User Action Args
2015-04-15 15:27:14wiggin15setrecipients: + wiggin15, skip.montanaro, steven.daprano, martin.panter, worr, ulaganathanm123@gmail.com
2015-04-15 15:27:14wiggin15setmessageid: <1429111634.8.0.550110783124.issue23949@psf.upfronthosting.co.za>
2015-04-15 15:27:14wiggin15linkissue23949 messages
2015-04-15 15:27:14wiggin15create