New submission from Cat Chenal <catche...@gmail.com>:

S = {19,8,-1,25,0,1,2,3,4,5,6,7}

a, *b, c = S
print('a:', a)
print('b:', b)
print('c:', c)

Output:
a: 0
b: [1, 2, 3, 4, 5, 6, 7, 8, 19, 25]
c: -1

Either test_unpack.py needs a test for "non-indexable object" to prevent this 
unpacking of a non-sequence, or the unpacking of a set should be implemented 
(granted the ordered repr of a set is changed to unordered, see Issue38853).

Being able to "unpack" a set would be nice to have, imho, because one would use 
that operation to obtain a partition (over unordered elements).

----------
components: Tests, ctypes
messages: 356994
nosy: Ylem
priority: normal
severity: normal
status: open
title: test_unpack.py does not catch the unpacking of a set
versions: Python 3.6

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue38855>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to