On Sun, Aug 30, 2020 at 8:36 PM Random832 <random832@fastmail.com> wrote:
The thing that bothers me with new dunders is - can it be done in such a way that *all* possible ways of calling it with only positional arguments behave the same as presently when the old one is defined, and an intuitive way with the new one, without requiring the calling bytecode to know which signature is going to be used?

Probably not. (And knowing the signature is impossible -- there are too many layers of C code between the bytecode and the function object being called.) This is why I ended up with the simplest proposal possible -- keyword args get added to the end of `__getitem__` and `__setitem__`, ensuring that `d[1, k=3]` is like `d[1]` + keyword, not like `d[1,]` + keyword.

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