From: Stefan Behnel Date: Sat, 30 Oct 2010 18:00:47 +0000 (+0200) Subject: more missing 'directives' dicts, 'bool' actually is final in CPython X-Git-Tag: 0.14.alpha0~277 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=46e443be5b3dfbef7c664ca6730a92941c616246;p=cython.git more missing 'directives' dicts, 'bool' actually is final in CPython --- 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