[docs] [issue37934] Docs: Clarify NotImplemented use cases

Kyle Stanley report at bugs.python.org
Tue Sep 3 00:38:48 EDT 2019


Kyle Stanley <aeros167 at gmail.com> added the comment:

Thanks for the explanation.

> Of course, you might argue that _once Python has NotImplemented_, it can be used elsewhere - but as I said, I don't think it should be encouraged.

Hmm, okay. My understanding of Raymond's explanation was more so "let's not encourage this because we don't want to guarantee the behavior" rather than "using it outside of binary operators shoudn't be encouraged".

Prior to Jerome's usage of it in ``fractions._as_integer_ratio()`` (https://github.com/python/cpython/pull/15327/files), I had not seen it used outside of special binary operators. I thought it was an interesting usage of NotImplemented, and the current phrasing of the documentation seemed to implicitly discourage it from being used in that manner.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue37934>
_______________________________________


More information about the docs mailing list