Note on why we don't implement equality

This commit is contained in:
Tzu-ping Chung 2020-04-04 21:51:20 +08:00
parent 018c051a8e
commit 591d476fca
1 changed files with 4 additions and 0 deletions

View File

@ -420,6 +420,10 @@ class RequiresPythonCandidate(Candidate):
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