partial backport from cython-unstable: keep Python literals from loosing their type...
authorStefan Behnel <scoder@users.berlios.de>
Sat, 12 Sep 2009 11:58:42 +0000 (13:58 +0200)
committerStefan Behnel <scoder@users.berlios.de>
Sat, 12 Sep 2009 11:58:42 +0000 (13:58 +0200)
Cython/Compiler/ExprNodes.py

index 2b0de0eb1719ada1bd534570ab459825ef1b34bb..6d649a43602c3a00f77febf82e94e56ab9b6f353 100644 (file)
@@ -748,12 +748,13 @@ class PyConstNode(AtomicNewTempExprNode):
     #  Abstract base class for constant Python values.
     
     is_literal = 1
+    type = py_object_type
     
     def is_simple(self):
         return 1
     
     def analyse_types(self, env):
-        self.type = py_object_type
+        pass
     
     def calculate_result_code(self):
         return self.value