requests
requests copied to clipboard
Remove redundant __ne__ methods
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 fromHTTPBasicAuthclass - Removed redundant
__ne__method fromHTTPDigestAuthclass
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