diff --git a/news/4a85b5f1-5f9a-4f6b-8960-3334570ae591.trivial.rst b/news/4a85b5f1-5f9a-4f6b-8960-3334570ae591.trivial.rst new file mode 100644 index 000000000..e69de29bb diff --git a/src/pip/_internal/models/format_control.py b/src/pip/_internal/models/format_control.py index fc2747c95..eb46f2535 100644 --- a/src/pip/_internal/models/format_control.py +++ b/src/pip/_internal/models/format_control.py @@ -36,10 +36,6 @@ class FormatControl: for k in self.__slots__ ) - def __ne__(self, other): - # type: (object) -> bool - return not self.__eq__(other) - def __repr__(self): # type: () -> str return "{}({}, {})".format( diff --git a/src/pip/_internal/resolution/resolvelib/candidates.py b/src/pip/_internal/resolution/resolvelib/candidates.py index 2453b65ac..6725684a5 100644 --- a/src/pip/_internal/resolution/resolvelib/candidates.py +++ b/src/pip/_internal/resolution/resolvelib/candidates.py @@ -164,11 +164,6 @@ class _InstallRequirementBackedCandidate(Candidate): return self._link == other._link return False - # Needed for Python 2, which does not implement this by default - def __ne__(self, other): - # type: (Any) -> bool - return not self.__eq__(other) - @property def source_link(self): # type: () -> Optional[Link] @@ -378,11 +373,6 @@ class AlreadyInstalledCandidate(Candidate): return self.name == other.name and self.version == other.version return False - # Needed for Python 2, which does not implement this by default - def __ne__(self, other): - # type: (Any) -> bool - return not self.__eq__(other) - @property def project_name(self): # type: () -> str @@ -475,11 +465,6 @@ class ExtrasCandidate(Candidate): return self.base == other.base and self.extras == other.extras return False - # Needed for Python 2, which does not implement this by default - def __ne__(self, other): - # type: (Any) -> bool - return not self.__eq__(other) - @property def project_name(self): # type: () -> str diff --git a/src/pip/_internal/utils/models.py b/src/pip/_internal/utils/models.py index e7db67a93..c14e9ff92 100644 --- a/src/pip/_internal/utils/models.py +++ b/src/pip/_internal/utils/models.py @@ -34,9 +34,6 @@ class KeyBasedCompareMixin: def __eq__(self, other): return self._compare(other, operator.__eq__) - def __ne__(self, other): - return self._compare(other, operator.__ne__) - def _compare(self, other, method): if not isinstance(other, self._defining_class): return NotImplemented diff --git a/tests/unit/test_utils.py b/tests/unit/test_utils.py index 7b24c8983..9c43d5531 100644 --- a/tests/unit/test_utils.py +++ b/tests/unit/test_utils.py @@ -847,8 +847,7 @@ class TestHiddenText: hidden2 = HiddenText('secret', redacted='####') assert hidden1 == hidden2 - # Also test __ne__. This assertion fails in Python 2 without - # defining HiddenText.__ne__. + # Also test __ne__. assert not hidden1 != hidden2 def test_equality_different_secret(self):