From: Robert Bradshaw Date: Sat, 7 Jul 2007 08:56:57 +0000 (-0700) Subject: sagex_multi_file.patch from Joel Mohler (sane cross-file type cmp) X-Git-Tag: 0.9.6.14~29^2~177^2~1 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=efb47ac78e94a7bb8c5605e0f8211036a600ab0c;p=cython.git sagex_multi_file.patch from Joel Mohler (sane cross-file type cmp) --- diff --git a/Cython/Compiler/PyrexTypes.py b/Cython/Compiler/PyrexTypes.py index 1cad0735..17ae138e 100644 --- a/Cython/Compiler/PyrexTypes.py +++ b/Cython/Compiler/PyrexTypes.py @@ -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