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 alexmojaki
Recipients alexmojaki
Date 2020-03-01.19:35:48
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1583091348.39.0.0422747327362.issue39816@roundup.psfhosted.org>
In-reply-to
Content
Based on the discussion in https://mail.python.org/archives/list/python-ideas@python.org/thread/C6QEAEEAELUHMLB23OBRSQK2UYU3AF5O/

When unpacking fails with an error such as:

ValueError: too many values to unpack (expected 2)

the name of the type of the unpacked object should be included, e.g.

ValueError: too many values to unpack (expected 2) from object of type 'str'

and if the type is exactly list or tuple, which are already special cased: https://github.com/python/cpython/blob/baf29b221682be0f4fde53a05ea3f57c3c79f431/Python/ceval.c#L2243-L2252

then the length can also be included:

ValueError: too many values to unpack (expected 2, got 3) from object of type 'tuple'
History
Date User Action Args
2020-03-01 19:35:48alexmojakisetrecipients: + alexmojaki
2020-03-01 19:35:48alexmojakisetmessageid: <1583091348.39.0.0422747327362.issue39816@roundup.psfhosted.org>
2020-03-01 19:35:48alexmojakilinkissue39816 messages
2020-03-01 19:35:48alexmojakicreate