bpo-32259: Make a TypeError message when unpack non-iterable more specific. (#4903)

This commit is contained in:
Serhiy Storchaka 2017-12-26 12:30:41 +02:00 committed by GitHub
parent a8f4e15f3d
commit 13a6c098c2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 16 additions and 6 deletions

View file

@ -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