[New-bugs-announce] [issue3254] Suggestion: change default behavior of __ne__

cvp report at bugs.python.org
Tue Jul 1 23:36:18 CEST 2008


New submission from cvp <cperepelitsa at gmail.com>:

After defining my own __eq__ method for a class that judged equality
based on a 'name' variable, imagine my surprise to see this:

In [20]: my_graph.edges[-1].end == my_graph.vertices[-1]
Out [20]: True

In [21]: my_graph.edges[-1].end != my_graph.vertices[-1]
Out [21]: True

...all because I forgot to modify __ne__ as well.

I think __ne__ should be changed to 'not __eq__' for the sake of
consistency.

----------
messages: 69078
nosy: cvp
severity: normal
status: open
title: Suggestion: change default behavior of __ne__
type: behavior

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue3254>
_______________________________________


More information about the New-bugs-announce mailing list