04.03.19 15:43, Serhiy Storchaka пише:
01.03.19 12:44, Steven D'Aprano пише:
On Fri, Mar 01, 2019 at 08:47:36AM +0200, Serhiy Storchaka wrote:
Also, if the custom dict subclass implemented the plus operator with
different semantic which supports the addition with a dict, this change
will break it, because dict + CustomDict will call dict.__add__ instead
of CustomDict.__radd__.

That's not how operators work in Python or at least that's not how they
worked the last time I looked: if the behaviour has changed without
discussion, that's a breaking change that should be reverted.

You are right.

Actually there is still a problem if the first argument is an instance of dict subclass that does not implement __add__.

_______________________________________________
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to