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 steven.daprano
Recipients Jacob RR, docs@python, steven.daprano
Date 2020-04-06.09:51:57
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1586166717.15.0.36997173033.issue40202@roundup.psfhosted.org>
In-reply-to
Content
I think the error messages could be improved.

In the first example: `f,x, a, b = [1,2,3]`

you are unpacking three values, but you need to unpack 4. The error message is not very helpful: 5 values is "more than 3" but it would be too many, you need not "more than 3" but exactly 4.

In the second example `a, b = [1,2,3]` it would be nice if it would tell you how many values you need to unpack.

Ideally, the message would say something like:

    Need to unpack 4 values but got 3  # first example
    Need to unpack 2 values but got 3  # second example

However I don't know if this is possible with the current parser, it might not be possible until the parser is changed (maybe in 3.9?)
History
Date User Action Args
2020-04-06 09:51:57steven.dapranosetrecipients: + steven.daprano, docs@python, Jacob RR
2020-04-06 09:51:57steven.dapranosetmessageid: <1586166717.15.0.36997173033.issue40202@roundup.psfhosted.org>
2020-04-06 09:51:57steven.dapranolinkissue40202 messages
2020-04-06 09:51:57steven.dapranocreate