On Mon, Aug 31, 2020 at 12:12 AM Greg Ewing <greg.ew...@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] > > That would make it clearer that the indexing syntax still really only takes one positional arg, I see the appeal here, but then: a[1, 2] would be legal, and suddenly a[1,2, this=4] would not. if the keywords were optional (aren't they always?) then that would be pretty confusing. -CHB > 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] > > -- > Greg > _______________________________________________ > Python-ideas mailing list -- python-ideas@python.org > To unsubscribe send an email to python-ideas-le...@python.org > https://mail.python.org/mailman3/lists/python-ideas.python.org/ > Message archived at > https://mail.python.org/archives/list/python-ideas@python.org/message/67QRIQFTT3IJ4ZZCF73DEQYAVP3H2MDU/ > Code of Conduct: http://python.org/psf/codeofconduct/ > -- Christopher Barker, PhD Python Language Consulting - Teaching - Scientific Software Development - Desktop GUI and Web Development - wxPython, numpy, scipy, Cython
_______________________________________________ Python-ideas mailing list -- python-ideas@python.org To unsubscribe send an email to python-ideas-le...@python.org https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message archived at https://mail.python.org/archives/list/python-ideas@python.org/message/NMG42XJKRD4SOTDDO52KMCZQH7WOQ66M/ Code of Conduct: http://python.org/psf/codeofconduct/