#23949: Improve tuple unpacking error messages.

Patch by Arnon Yaari.
This commit is contained in:
R David Murray 2015-04-15 17:08:45 -04:00
parent 13a6ee0af4
commit 4171bbe687
3 changed files with 26 additions and 9 deletions

View file

@ -85,7 +85,14 @@ Unpacking sequence too short
>>> a, *b, c, d, e = Seq()
Traceback (most recent call last):
...
ValueError: need more than 3 values to unpack
ValueError: not enough values to unpack (expected at least 4, got 3)
Unpacking sequence too short and target appears last
>>> a, b, c, d, *e = Seq()
Traceback (most recent call last):
...
ValueError: not enough values to unpack (expected at least 4, got 3)
Unpacking a sequence where the test for too long raises a different kind of
error