Roundup Tracker - Issues

Issue 2551419

classification
Remove __ne__ methods in classes when they are just ! __eq__
Type: resource usage Severity: minor
Components: Database, Web interface, Mail interface, Command-line interface, User Interface, API Versions:
process
Status: fixed fixed
:
: rouilj : rouilj
Priority: :

Created on 2026-07-29 15:09 by rouilj, last changed 2026-07-30 12:55 by rouilj.

Messages
msg8464 Author: [hidden] (rouilj) Date: 2026-07-29 15:09
Since python 3, __ne__ is defined in terms of __eq__ by the default object class.

It looks like 2 classes in security.py and password.py define an __ne__ as:

   return not self.__eq__(other)

so these two defs can be removed.

The other instances define __ne__ in terms of cmp, return False or add isinstance()
checks before using != operator.
msg8470 Author: [hidden] (rouilj) Date: 2026-07-29 23:28
Reference: https://adamj.eu/tech/2026/07/28/python-fix-typeerror-notimplemented-boolean-context/
msg8472 Author: [hidden] (rouilj) Date: 2026-07-30 12:55
done in changeset:   8733:760e3cc48b8c
History
Date User Action Args
2026-07-30 12:55:28rouiljsetstatus: new -> fixed
resolution: fixed
messages: + msg8472
2026-07-29 23:28:46rouiljsetmessages: + msg8470
2026-07-29 15:09:12rouiljcreate