[New-bugs-announce] [issue21408] delegation of `!=` to the right-hand side argument is not always done
report at bugs.python.org
Thu May 1 16:31:27 CEST 2014
New submission from Jean-Paul Calderone:
$ ~/Projects/cpython/3.4/python -c '
def __ne__(self, other):
def __eq__(self, other):
print(object() != Foo(), object() == Foo())
print(Bar() != Foo(), Bar() == Foo())
The output I would expect from this is
That is, even when the type of the left-hand argument is not a base class of the type of the right-hand argument, delegation to the right-hand argument is sensible if the left-hand argument does not implement the comparison.
Note that the output also demonstrates that this is already the behavior for `==`. Only `!=` seems to suffer from this issue.
components: Interpreter Core
title: delegation of `!=` to the right-hand side argument is not always done
versions: Python 3.3, Python 3.4
Python tracker <report at bugs.python.org>
More information about the New-bugs-announce