On Mon, Oct 7, 2019, at 09:22, Rhodri James wrote: > > Allowing key value pairs in geitem need not change the interface of > > getitem. All the key value pairs could be collected as a dict and passed > > to getitem as the index. > > Um. Stop me if I'm wrong, but isn't that exactly a change to the > interface of getitem?
Missed this on my previous reply - I think his point is that that the __getitem__ function *itself* would continue to take a singular positional argument (and so the C API for tp_getitem etc wouldn't have to change), it would merely be an additional way to construct that argument, just as x[a, b] passes a tuple (a, b) rather than two positional arguments. Presumably, x[a, b, c=d, e=f] would pass a tuple (a, b, {c: d, e: f}). _______________________________________________ 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/EBOLPMTCY6PB2ACEWPZEKKF6OSPJWGJY/ Code of Conduct: http://python.org/psf/codeofconduct/