self.is_temp = 1
def generate_result_code(self, code):
- code.putln("%s = PyList_Append(%s, %s); %s" %
+ code.putln("%s = PyList_Append(%s, (PyObject*)%s); %s" %
(self.result_code,
self.target.result_code,
self.expr.result_code,
--- /dev/null
+u"""
+>>> smoketest()
+[0, 4, 8]
+>>> typed()
+[A, A, A]
+"""
+
+def smoketest():
+ print [x*2 for x in range(5) if x % 2 == 0]
+
+cdef class A:
+ def __repr__(self): return "A"
+
+def typed():
+ cdef A obj
+ print [obj for obj in [A(), A(), A()]]
\ No newline at end of file