New submission from wim glenn <wim.gl...@gmail.com>:
Qualifying that the right operand's type must be a *strict* subclass for the reflected method to take precedence avoids an edge case / counter-example when the types are actually equal. >>> class A: ... def __add__(self, other): ... print(1) ... def __radd__(self, other): ... print(2) ... >>> A() + A() 1 >>> issubclass(A, A) True ---------- assignee: docs@python components: Documentation messages: 376944 nosy: docs@python, wim.glenn priority: normal severity: normal status: open title: Inaccuracy about reflected operands in datamodel docs. _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue41793> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com