From f0899127486265fc66632631cf542da5ff7c9b6f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Barrois?= Date: Tue, 20 Aug 2019 22:56:31 +0200 Subject: Clarify hashing strategy for Version. --- semantic_version/base.py | 2 ++ 1 file changed, 2 insertions(+) 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): -- cgit v1.2.1