[issue45586] Use starred expressions in list indices

2021-10-23 Thread Jacob Nilsson
Jacob Nilsson 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 b

[issue45586] Use starred expressions in list indices

2021-10-23 Thread Jacob Nilsson
Jacob Nilsson added the comment: I don't understand, do you mean that lists should work like in your example? Or that your example code doesn't run? If you mean the first issue, that is ok I guess but I've never used indexing like that outside of numpy, pandas and the like. If you mean the

[issue45586] Use starred expressions in list indices

2021-10-23 Thread Alex Waygood
Change by Alex Waygood : -- type: -> enhancement versions: +Python 3.11 -Python 3.10 ___ Python tracker ___ ___ Python-bugs-list ma

[issue45586] Use starred expressions in list indices

2021-10-23 Thread Peter Tillema
New submission from Peter Tillema : It would be nice if you could starred expressions in list indices, for example this piece of code: ``` import numpy as np a = np.array(0) print(a[1, *[2, 3], 4]) ``` -- components: Interpreter Core messages: 404860 nosy: PeterTillema priority: norm