Zachary Ware added the comment:
Absent clarification from the OP (though it appears some may have been added to
bpo-38853), I'm closing the issue.
--
resolution: -> not a bug
stage: -> resolved
status: open -> closed
___
Python tracker
Raymond Hettinger added the comment:
I'm also unclear on what you're looking for. Unpacking is documented to allow
any iterable. This includes all kinds of potentially weird but potentially
useful cases including unordered collections, strings, files, etc. These
behaviors are unlikely to
Zachary Ware added the comment:
It's not clear what you're asking for here. Your example works, though the
contents of `a` and `c` will each be an arbitrary member of S and `b` the rest
of the members of S and you have no guarantee of what you'll get. If you want
to be sure of what each
New submission from Cat Chenal :
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