From: Robert Bradshaw Date: Sun, 4 Oct 2009 05:37:02 +0000 (-0700) Subject: Better display for complex types X-Git-Tag: 0.12.alpha0~177^2~8 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=578d94c507d4b43a84aa4d0e5e74686b373d07ad;p=cython.git Better display for complex types --- diff --git a/Cython/Compiler/PyrexTypes.py b/Cython/Compiler/PyrexTypes.py index 459b18c0..f4854441 100644 --- a/Cython/Compiler/PyrexTypes.py +++ b/Cython/Compiler/PyrexTypes.py @@ -850,9 +850,17 @@ class CComplexType(CNumericType): def __hash__(self): return ~hash(self.real_type) + def declaration_code(self, entity_code, + for_display = 0, dll_linkage = None, pyrex = 0): + if for_display: + base = public_decl(self.real_type.sign_and_name() + " complex", dll_linkage) + else: + base = public_decl(self.sign_and_name(), dll_linkage) + return self.base_declaration_code(base, entity_code) + def sign_and_name(self): return Naming.type_prefix + self.real_type.specalization_name() + "_complex" - + def assignable_from_resolved_type(self, src_type): return (src_type.is_complex and self.real_type.assignable_from_resolved_type(src_type.real_type) or src_type.is_numeric and self.real_type.assignable_from_resolved_type(src_type)