This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author wim.glenn
Recipients docs@python, wim.glenn
Date 2020-09-15.15:59:08
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1600185548.76.0.619464921638.issue41793@roundup.psfhosted.org>
In-reply-to
Content
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
History
Date User Action Args
2020-09-15 15:59:08wim.glennsetrecipients: + wim.glenn, docs@python
2020-09-15 15:59:08wim.glennsetmessageid: <1600185548.76.0.619464921638.issue41793@roundup.psfhosted.org>
2020-09-15 15:59:08wim.glennlinkissue41793 messages
2020-09-15 15:59:08wim.glenncreate