[issue36761] Extended slice assignment + iterable unpacking

2020-01-08 Thread wim glenn
Change by wim glenn : -- stage: -> resolved status: open -> closed ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubsc

[issue36761] Extended slice assignment + iterable unpacking

2019-05-13 Thread wim glenn
wim glenn added the comment: Serhiy, `a, *L[::2] = "abc"` as an alternative is interesting, thanks. The other example `L[:], *rest = 'abcdef'` is less interesting because L[:] can be arbitrary size. When noticing this, I had tried to consume a generator into every other position in a list

[issue36761] Extended slice assignment + iterable unpacking

2019-05-01 Thread Windson Yang
Windson Yang 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

[issue36761] Extended slice assignment + iterable unpacking

2019-05-01 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: For the second case, you can use a, *L[::2] = "abc" For the first case this does not work, because an assignment can have only one starred expression. Making the first case to work as you expected is breaking change. Currently L[:], *rest = 'abcdef' set

[issue36761] Extended slice assignment + iterable unpacking

2019-05-01 Thread SilentGhost
Change by SilentGhost : -- nosy: +georg.brandl, gvanrossum versions: +Python 3.8 ___ Python tracker ___ ___ Python-bugs-list mailing

[issue36761] Extended slice assignment + iterable unpacking

2019-04-30 Thread wim glenn
New submission from wim glenn : Could cases like these be made to work? *Should* cases like these be made to work? L = [0, 1, 2] L[::2], *rest = "abcdef" # ValueError: attempt to assign sequence of size 1 to extended slice of size 2 a, L[::2] = "abc" # ValueError: too many values to unpack (e