[issue22780] NotImplemented doc section needs update
Ethan Furman
report at bugs.python.org
Tue Nov 4 08:38:36 CET 2014
Ethan Furman added the comment:
How about:
Special value which should be returned by the binary special methods
(e.g. :meth:`__eq__`, :meth:`__lt__`, :meth:`__add__`, :meth:`__rsub__`,
etc.) to indicate that the operation is not implemented with respect to
the other type; may be returned by the in-place binary special methods
(e.g. :meth:`__imul__`, :meth:`__iand__`, etc.) for the same purpose.
Its truth value is true.
Note::
When NotImplemented is returned, the interpreter will then try the
reflected operation on the other type, or some other fallback, depending
on the operator. If all attempted operations return NotImplemented, the
interpreter will raise an appropriate exception.
I have no idea how to create a link to the 'Implementing the arithmetic operations' section. Any clues?
----------
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue22780>
_______________________________________
More information about the Python-bugs-list
mailing list