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 max
Recipients docs@python, max
Date 2012-09-21.05:50:29
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1348206637.53.0.485410334327.issue15997@psf.upfronthosting.co.za>
In-reply-to
Content
Quoting from http://docs.python.org/reference/datamodel.html#the-standard-type-hierarchy:

NotImplemented
This type has a single value. There is a single object with this value. This object is accessed through the built-in name NotImplemented. Numeric methods and rich comparison methods may return this value if they do not implement the operation for the operands provided. (The interpreter will then try the reflected operation, or some other fallback, depending on the operator.) Its truth value is true.

This is not a sufficient description of NotImplemented behavior. What does it mean "reflected operation" (I assume it is other.__eq__(self), but it needs to be clarified), and what does it mean "or some other fallback" (wouldn't developers need to know?). It also doesn't state what happens if the reflected operation or the fallback again return NotImplemented.

The rest of the documentation doesn't seem to talk about this either, despite several mentions of NotImplemented, with references to other sections.

This is particularly serious problem because Python's behavior changed in this respect not that long ago.
History
Date User Action Args
2012-09-21 05:50:37maxsetrecipients: + max, docs@python
2012-09-21 05:50:37maxsetmessageid: <1348206637.53.0.485410334327.issue15997@psf.upfronthosting.co.za>
2012-09-21 05:50:31maxlinkissue15997 messages
2012-09-21 05:50:29maxcreate