New submission from Brett Cannon <br...@python.org>:

https://docs.python.org/3/reference/datamodel.html#object.__ror__ has a note 
saying:

"If the right operand's type is a subclass of the left operand's type and that 
subclass provides the reflected method for the operation, this method will be 
called before the left operand's non-reflected method." The slightly unclear 
part (at least to me) is the "provides the reflected method."

What this actually means according to https://bugs.python.org/issue30140 is 
that the subclass **implements** the `__r*__` method, not just that the method 
is reachable on the subclass via getattr(). That wasn't clear to me when I 
initially read this.

----------
assignee: docs@python
components: Documentation
messages: 375621
nosy: brett.cannon, docs@python
priority: normal
severity: normal
stage: needs patch
status: open
title: Clarify documentation for binary arithmetic operation subclass __r*__ 
precedence
versions: Python 3.10, Python 3.8, Python 3.9

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue41584>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to