Skip to content

Commit

Permalink
Note on why we don't implement equality
Browse files Browse the repository at this point in the history
  • Loading branch information
uranusjr committed Apr 8, 2020
1 parent 018c051 commit 591d476
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/pip/_internal/resolution/resolvelib/candidates.py
Original file line number Diff line number Diff line change
Expand Up @@ -420,6 +420,10 @@ def __init__(self, py_version_info):
version_info = sys.version_info[:3]
self._version = Version(".".join(str(c) for c in version_info))

# We don't need to implement __eq__() and __ne__() since there is always
# only one RequiresPythonCandidate in a resolution, i.e. the host Python.
# The built-in object.__eq__() and object.__ne__() do exactly what we want.

@property
def name(self):
# type: () -> str
Expand Down

0 comments on commit 591d476

Please sign in to comment.