On Sat, Aug 29, 2020 at 4:08 PM Guido van Rossum <gu...@python.org> wrote:
> [...] > Finally, I am unsure how you would deal with the difference between d[1] > and d[1,], which must be preserved (for `__keyfn__ = True` or absent, for > backwards compatibility). The bytecode compiler cannot assume to know the > value of `__keyfn__` (because d could be defined in another module or could > be an instance of one of several classes defined in the current module). (I > think this problem is also present in the `__subscript__` version.) > This problem is actually also present in Steven's version (which just passes keyword args as **kwargs to `__getitem__` and `__setitem__`). We could treat d[1, a=3] either as d[1,] + kwargs or as d[1] + kwargs. Have people debated this yet? (It is not a problem in Jonathan's version for `__keyfn__ = None`, but since the proposal also has to support `__keyfn__ = True`, it is still a problem there.) -- --Guido van Rossum (python.org/~guido) *Pronouns: he/him **(why is my pronoun here?)* <http://feministing.com/2015/02/03/how-using-they-as-a-singular-pronoun-can-change-the-world/>
_______________________________________________ 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/PMP4FD4P7GZZ6QQYJ42Q3IT7CKJSJEGQ/ Code of Conduct: http://python.org/psf/codeofconduct/