From f86f0505eade741af47a7cb5e603240ba5f03b9d Mon Sep 17 00:00:00 2001 From: Collin Funk Date: Tue, 16 Apr 2024 12:13:08 -0700 Subject: [PATCH] gnulib-tool.py: Make GLModule's __eq__ and __hash__ method agree. * pygnulib/GLModuleSystem.py (GLModuleTable.__hash__): Only use the module name in hash computations. --- ChangeLog | 6 ++++++ pygnulib/GLModuleSystem.py | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 03c6919131..613a6c85dd 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 Collin Funk gnulib-tool.py: Prefer 'not in' over 'not ... in'. 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 @@ def __gt__(self, module: object) -> bool: 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: -- 2.44.0