requests icon indicating copy to clipboard operation
requests copied to clipboard

Remove redundant __ne__ methods

Open khanashes opened this issue 1 month ago • 0 comments

Summary

In Python 3, when __eq__ is defined, Python automatically provides __ne__ by negating __eq__. Explicitly defining __ne__ is redundant and unnecessary code.

Changes

  • Removed redundant __ne__ method from HTTPBasicAuth class
  • Removed redundant __ne__ method from HTTPDigestAuth class

Testing

All existing authentication tests pass (50 tests), confirming that Python's automatic __ne__ implementation works correctly:

50 passed, 561 deselected, 8 warnings in 5.33s

Benefits

  • Cleaner, more maintainable code
  • Follows Python 3 best practices
  • Reduces code duplication
  • No functional changes - behavior remains identical

khanashes avatar Nov 26 '25 20:11 khanashes