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.

classification
Title: Python 3 changement of behavior with __ne__: documentation not updated
Type: Stage:
Components: Documentation Versions: Python 3.1, Python 3.2, Python 3.3, Python 3.4, Python 3.5
process
Status: closed Resolution: duplicate
Dependencies: Superseder: Document auto __ne__ generation; provide a use case for non-trivial __ne__
View: 4395
Assigned To: docs@python Nosy List: docs@python, franck, mark.dickinson
Priority: normal Keywords:

Created on 2013-02-07 15:34 by franck, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Messages (2)
msg181620 - (view) Author: Franck Michea (franck) * Date: 2013-02-07 15:34
Hi. As of python 3, behavior of object.__ne__ changed to call (not object.__eq__) if implemented. This changement can be seen in function object_richcompare in file Objects/typeobject.c.

Documentation didn't change though, still saying[1] that "There are no implied relationships among the comparison operators. [...] Accordingly, when defining __eq__(), one should also define __ne__()".

Maybe a paragraph about this new behavior would be fine? I am not sure if last sentence of last paragraph is what it means, but it was already there in python 2 doc so guess no. I am not sure about how to write it so no patch, sorry.

[1] http://docs.python.org/3.3/reference/datamodel.html#object.__eq__
msg181629 - (view) Author: Mark Dickinson (mark.dickinson) * (Python committer) Date: 2013-02-07 16:27
There's a (long-standing) issue already open for this: #4395.  I'll close this as a duplicate and add a note to that issue;  with any luck, pinging that issue might produce some movement.
History
Date User Action Args
2022-04-11 14:57:41adminsetgithub: 61353
2013-02-07 16:27:09mark.dickinsonsetstatus: open -> closed

nosy: + mark.dickinson
messages: + msg181629

superseder: Document auto __ne__ generation; provide a use case for non-trivial __ne__
resolution: duplicate
2013-02-07 15:34:19franckcreate