On 15.12.15 15:04, Victor Stinner wrote:
Should Python emit a warning when __eq__() is implemented but not __ne__()?
No. Actually I had removed a number of redundant (and often incorrect) __ne__ implementations after fixing object.__ne__.
Should Python be modified to call "not __eq__()" when __ne__() is not implemented?
__ne__() always is implemented (inherited from object). Default __ne__ implementation calls __eq__() and negate it's result (if not NotImplemented).
But user class can define __ne__ with arbitrary semantic. That is the purpose of adding __ne__.
_______________________________________________ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com