[issue45586] Use starred expressions in list indices

Jacob Nilsson report at bugs.python.org
Sat Oct 23 16:11:41 EDT 2021


Jacob Nilsson <jacob.nilsson at ltu.se> added the comment:

Oh yeah, the reason lists don't allow the starred expression has nothing to do with the starred expression itself, it's syntactically correct and in your case a[1, *[2, 3], 4] is equivalent to a[1, 2, 3, 4]. The "problem" is that lists do not allow indexing by tuples.

Perhaps the title of this issue should be changed to reflect that: "Allow lists to be indexed by tuples"

----------

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


More information about the Python-bugs-list mailing list