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 Ylem
Recipients Ylem
Date 2019-11-19.21:44:26
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1574199866.94.0.505972513072.issue38855@roundup.psfhosted.org>
In-reply-to
Content
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).
History
Date User Action Args
2019-11-19 21:44:26Ylemsetrecipients: + Ylem
2019-11-19 21:44:26Ylemsetmessageid: <1574199866.94.0.505972513072.issue38855@roundup.psfhosted.org>
2019-11-19 21:44:26Ylemlinkissue38855 messages
2019-11-19 21:44:26Ylemcreate