[issue36761] Extended slice assignment + iterable unpacking

Windson Yang report at bugs.python.org
Wed May 1 21:22:34 EDT 2019


Windson Yang <wiwindson at outlook.com> added the comment:

In your first case, *any positive index except 2 will work*, For example:

L = [0, 1, 2]
L[::1], *rest = "abcdef" # L became ['a']
or 
L[::3], *rest = "abcdef" # L became ['a', 1, 2]

I found iff when you change the length of L to 1(L[::3]) or didn't change L at all (L[::1], L[::]), this expression will work. But I'm not sure that is what you expected.

----------
nosy: +Windson Yang

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue36761>
_______________________________________


More information about the Python-bugs-list mailing list