]> git.ipfire.org Git - thirdparty/gnulib.git/commitdiff
gnulib-tool.py: Make GLModule's __eq__ and __hash__ method agree.
authorCollin Funk <collin.funk1@gmail.com>
Tue, 16 Apr 2024 19:13:08 +0000 (12:13 -0700)
committerBruno Haible <bruno@clisp.org>
Tue, 16 Apr 2024 22:53:18 +0000 (00:53 +0200)
* pygnulib/GLModuleSystem.py (GLModuleTable.__hash__): Only use the
module name in hash computations.

ChangeLog
pygnulib/GLModuleSystem.py

index 6d4d37cca89ce72305853d7bd431fa71f6c380fe..7d4a3317cac1836d4907ef27f75cb468e303a4fd 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2024-04-16  Collin Funk  <collin.funk1@gmail.com>
+
+       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  <bruno@clisp.org>
 
        setpayloadsigl: Add tests.
index 3148f921e127b341dfb62b1656ce2988b3f9d37e..6aed38b9eba932f8244854097f8c8c324ffdc2df 100644 (file)
@@ -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: