diff options
author | Raphaël Barrois <raphael.barrois@polytechnique.org> | 2019-08-20 22:56:31 +0200 |
---|---|---|
committer | Raphaël Barrois <raphael.barrois@polytechnique.org> | 2019-08-24 15:13:09 +0200 |
commit | f0899127486265fc66632631cf542da5ff7c9b6f (patch) | |
tree | fd57790863e933f2dcfe7ce412fe0b0a5ef57cbf | |
parent | e5e2082ce9288c113bfc1045877f931d165f9801 (diff) | |
download | semantic-version-f0899127486265fc66632631cf542da5ff7c9b6f.tar.gz |
Clarify hashing strategy for Version.
-rw-r--r-- | semantic_version/base.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/semantic_version/base.py b/semantic_version/base.py index 93291e7..48fdfbf 100644 --- a/semantic_version/base.py +++ b/semantic_version/base.py @@ -429,6 +429,8 @@ class Version: return 0 def __hash__(self): + # We don't include 'partial', since this is strictly equivalent to having + # at least a field being `None`. return hash((self.major, self.minor, self.patch, self.prerelease, self.build)) def __cmp__(self, other): |