Fix error in hashing partially-declared types.
authorRobert Bradshaw <robertwb@math.washington.edu>
Thu, 15 Oct 2009 05:34:58 +0000 (22:34 -0700)
committerRobert Bradshaw <robertwb@math.washington.edu>
Thu, 15 Oct 2009 05:34:58 +0000 (22:34 -0700)
Cython/Compiler/PyrexTypes.py

index f6474f85c4b542460c2a5a22ccfe4fe7c263716d..7453f943912241affcb887b6db02913c0292c916 100644 (file)
@@ -1590,12 +1590,7 @@ class CStructOrUnionType(CType):
             return False
 
     def __hash__(self):
-        try:
-            return self.__hashval
-        except AttributeError:
-            hashval = self.__hashval = hash(self.cname) ^ (sum([
-                hash(field.name) for field in self.scope.var_entries]) % 0xffff)
-            return hashval
+        return hash(self.cname) ^ hash(self.kind)
 
     def is_complete(self):
         return self.scope is not None