On Sat, Aug 29, 2020 at 4:08 PM Guido van Rossum <guido@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)