From 46e443be5b3dfbef7c664ca6730a92941c616246 Mon Sep 17 00:00:00 2001 From: Stefan Behnel Date: Sat, 30 Oct 2010 20:00:47 +0200 Subject: [PATCH] more missing 'directives' dicts, 'bool' actually is final in CPython --- Cython/Compiler/PyrexTypes.py | 1 + Cython/Compiler/Symtab.py | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/Cython/Compiler/PyrexTypes.py b/Cython/Compiler/PyrexTypes.py index 3509bd85..6a17c06d 100755 --- a/Cython/Compiler/PyrexTypes.py +++ b/Cython/Compiler/PyrexTypes.py @@ -1072,6 +1072,7 @@ class CComplexType(CNumericType): None, visibility="extern") scope.parent_type = self + scope.directives = {} scope.declare_var("real", self.real_type, None, "real", is_cdef=True) scope.declare_var("imag", self.real_type, None, "imag", is_cdef=True) entry = scope.declare_cfunction( diff --git a/Cython/Compiler/Symtab.py b/Cython/Compiler/Symtab.py index 9e0068a4..a160842f 100644 --- a/Cython/Compiler/Symtab.py +++ b/Cython/Compiler/Symtab.py @@ -726,7 +726,11 @@ class BuiltinScope(Scope): def declare_builtin_type(self, name, cname, utility_code = None): name = EncodedString(name) type = PyrexTypes.BuiltinObjectType(name, cname) - type.set_scope(CClassScope(name, outer_scope=None, visibility='extern')) + scope = CClassScope(name, outer_scope=None, visibility='extern') + scope.directives = {} + if name == 'bool': + scope.directives['final'] = True + type.set_scope(scope) self.type_names[name] = 1 entry = self.declare_type(name, type, None, visibility='extern') entry.utility_code = utility_code -- 2.26.2