On Mon, Aug 31, 2020 at 12:09 AM Greg Ewing <greg.ewing@canterbury.ac.nz> wrote:
I'm wondering whether parens should be required when there are both
keyword args and more than one positional arg in an index. I.e instead
of

     a[1, 2, k = 3]

you would have to write

     a[(1, 2), k = 3]

I think this would be horrible for the poor user who just wants to do something with an array data structure (e.g. something like xarray) using three dimensions, only one of which is named.
 
That would make it clearer that the indexing syntax still really only
takes one positional arg, and why, if you transform it into

     idx = (1, 2)
     a[idx, k = 3]

you don't/can't write it as

     a[*idx, k = 3]

This would make things simpler to understand for the implementer, but it's bad for the user. I'm sure if you ask the xarray implementers they don't care *how* keywords work as long as their users can write a[1, 2, k=3].

--
--Guido van Rossum (python.org/~guido)