> Let's assume MyMap does have a __setitem__ method. Extending what you > pointed out, the assignment > >>> m[K(1, 2, 3, a=4, b=5)] = 'foobar' > will then be equivalent to > >>> MyMap.__setitem__(m, k, 'foobar') > where > >>> k = K(1, 2, 3, a=4, b=5) > > This is confusing to me because `my_mapping[1,2,3]` is already valid syntax equivalent to `my_mapping.__setitem__(my_mapping, (1,2,3))`. Wouldn't a change to translate the tuple into this K object lead to big problems for a lot of existing code...?
_______________________________________________ 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/YR5Z6YEXDPEJDZHZN5LO7TLSXG26TFMZ/ Code of Conduct: http://python.org/psf/codeofconduct/