Returning NotImplemented from __eq__
<p>What's the result of returning <code>NotImplemented</code> from <code>__eq__</code> special method in python 3 (well 3.5 if it matters)?</p>

<p>The documentation isn't clear; the <a href="https://docs.python.org/3/library/constants.html#NotImplemented" rel="noreferrer">only relevant text I found</a> only vaguely refers to "some other fallback":</p>

<blockquote>
  <p>When <code>NotImplemented</code> 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 <code>NotImplemented</code>, the interpreter will raise an appropriate exception. See <a href="https://docs.python.org/3/library/numbers.html#implementing-the-arithmetic-operations" rel="noreferrer">Implementing the arithmetic operations</a> for more details.</p>
</blockquote>

<p>Unfortunately, the "more details" link doesn't mention <code>__eq__</code> at all.</p>

<p>My reading of this excerpt suggests that the code below should raise an "appropriate exception", but it does not:</p>

<pre><code>class A:
  def __eq__(self, other):
    return NotImplemented

class B:
  def __eq__(self, other):
    return NotImplemented

# docs seems to say these lines should raise "an appropriate exception"
# but no exception is raised
a = A()
b = B()
a == b # evaluates as unequal
a == a # evaluates as equal
</code></pre>

<p>From experimenting, I think that when <code>NotImplemented</code> is returned from <code>__eq__</code>, the interpreter behaves as if <code>__eq__</code> wasn't defined in the first place (specifically, it first swaps the arguments, and if that doesn't resolve the issue, it compares using the default <code>__eq__</code> that evaluates "equal" if the two objects have the same identity). If that's the case, where in the documentation can I find the confirmation of this behavior?</p>

<p>Edit: see <a href="http://bugs.python.org/issue28785" rel="noreferrer">Python issue 28785</a></p>