unpacking in index expression

April 6, 2016
10:26 p.m.
I was trying to unpack an array or tuple in index expression (python 3.5.1) but this failed. I think for consistency of language use it would be desirable to allow that as well. Below an example of my attempt indexing a numpy array, x:
for the case of numpy, the latter works as intended w/o unpacking
x[(0,1)] 1
which is equivalent to the desired behaviour of unpacking
x[0,1] 1
but for the list case the behaviour is different (as intended by design)
My proposal hence is to allow unpacking in index expressions as well. I do not have a use case for dictionary / keyword unpacking; this would look awkward anyway. -Alexander
3268
Age (days ago)
3269
Last active (days ago)
1 comments
2 participants
participants (2)
-
Alexander Heger
-
Serhiy Storchaka