more missing 'directives' dicts, 'bool' actually is final in CPython
authorStefan Behnel <scoder@users.berlios.de>
Sat, 30 Oct 2010 18:00:47 +0000 (20:00 +0200)
committerStefan Behnel <scoder@users.berlios.de>
Sat, 30 Oct 2010 18:00:47 +0000 (20:00 +0200)
Cython/Compiler/PyrexTypes.py
Cython/Compiler/Symtab.py

index 3509bd85b94775edbfc68c852f126b91daa050cb..6a17c06d1ad2dbb772fe102753a19d2a1b6a67d1 100755 (executable)
@@ -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(
index 9e0068a41b56e45ec395a9cf5eae98f3313dcf85..a160842fd22f22f318df217a8bb27bca8399a7f8 100644 (file)
@@ -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