Skip to content

Commit 6ff8dd8

Browse files
committed
Note on why we don't implement equality
1 parent 7a0a1e5 commit 6ff8dd8

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/pip/_internal/resolution/resolvelib/candidates.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -341,6 +341,10 @@ def __init__(self, py_version_info):
341341
version_info = sys.version_info[:3]
342342
self._version = Version(".".join(str(c) for c in version_info))
343343

344+
# We don't need to implement __eq__() and __ne__() since there is always
345+
# only one RequiresPythonCandidate in a resolution, i.e. the host Python.
346+
# The built-in object.__eq__() and object.__ne__() do exactly what we want.
347+
344348
@property
345349
def name(self):
346350
# type: () -> str

0 commit comments

Comments
 (0)