From 578d94c507d4b43a84aa4d0e5e74686b373d07ad Mon Sep 17 00:00:00 2001 From: Robert Bradshaw Date: Sat, 3 Oct 2009 22:37:02 -0700 Subject: [PATCH] Better display for complex types --- Cython/Compiler/PyrexTypes.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) 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) -- 2.26.2