sagex_multi_file.patch from Joel Mohler (sane cross-file type cmp)
authorRobert Bradshaw <robertwb@math.washington.edu>
Sat, 7 Jul 2007 08:56:57 +0000 (01:56 -0700)
committerRobert Bradshaw <robertwb@math.washington.edu>
Sat, 7 Jul 2007 08:56:57 +0000 (01:56 -0700)
Cython/Compiler/PyrexTypes.py

index 1cad073580202bc8351e0fade09e555098e7043f..17ae138ee99338671f6c958ea22bc5ef90f95f20 100644 (file)
@@ -618,6 +618,15 @@ class CStructOrUnionType(CType):
                 base = "%s %s" % (self.kind, self.cname)
             return "%s %s" % (public_decl(base, dll_linkage), entity_code)
 
+    def __cmp__(self, other):
+        try:
+            if self.name == other.name:
+                return 0
+            else:
+                return 1
+        except AttributeError:
+            return 1
+
     def is_complete(self):
         return self.scope is not None