Serhiy Storchaka <storchaka+cpyt...@gmail.com> 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'

sets L to ['a'] and rest to ['b', 'c', 'd', 'e', 'f']. Consistent implementing 
of your idea would set L to ['a', 'b', 'c'] and rest to ['d', 'e', 'f'] 
(because len(L[:]) == 3 before assignment).

What is your use case? Why do you need such syntax?

----------
nosy: +serhiy.storchaka

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

Reply via email to