From: Collin Funk Date: Tue, 16 Apr 2024 19:13:08 +0000 (-0700) Subject: gnulib-tool.py: Make GLModule's __eq__ and __hash__ method agree. X-Git-Tag: v1.0~71 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=daa21fd28d69b29b4c1ab0a98bbb4698fa62709b;p=thirdparty%2Fgnulib.git gnulib-tool.py: Make GLModule's __eq__ and __hash__ method agree. * pygnulib/GLModuleSystem.py (GLModuleTable.__hash__): Only use the module name in hash computations. --- diff --git a/ChangeLog b/ChangeLog index 6d4d37cca8..7d4a3317ca 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2024-04-16 Collin Funk + + gnulib-tool.py: Make GLModule's __eq__ and __hash__ method agree. + * pygnulib/GLModuleSystem.py (GLModuleTable.__hash__): Only use the + module name in hash computations. + 2024-04-16 Bruno Haible setpayloadsigl: Add tests. diff --git a/pygnulib/GLModuleSystem.py b/pygnulib/GLModuleSystem.py index 3148f921e1..6aed38b9eb 100644 --- a/pygnulib/GLModuleSystem.py +++ b/pygnulib/GLModuleSystem.py @@ -255,7 +255,7 @@ class GLModule: def __hash__(self) -> int: '''x.__hash__() <==> hash(x)''' - result = hash(self.name) ^ hash(self.patched) + result = hash(self.name) return result def __le__(self, module: object) -> bool: