mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
bpo-32259: Make a TypeError message when unpack non-iterable more specific. (#4903)
This commit is contained in:
parent
a8f4e15f3d
commit
13a6c098c2
5 changed files with 16 additions and 6 deletions
|
@ -55,7 +55,7 @@ Unpacking non-sequence
|
|||
>>> a, b, c = 7
|
||||
Traceback (most recent call last):
|
||||
...
|
||||
TypeError: 'int' object is not iterable
|
||||
TypeError: cannot unpack non-iterable int object
|
||||
|
||||
Unpacking tuple of wrong size
|
||||
|
||||
|
@ -129,7 +129,7 @@ Unpacking non-iterables should raise TypeError
|
|||
>>> () = 42
|
||||
Traceback (most recent call last):
|
||||
...
|
||||
TypeError: 'int' object is not iterable
|
||||
TypeError: cannot unpack non-iterable int object
|
||||
|
||||
Unpacking to an empty iterable should raise ValueError
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue