# code.put_decref(self.func_temp, PyrexTypes.py_object_type)
code.putln("}")
+class ClassDefNode(StatNode, BlockNode):
+ pass
-
-class PyClassDefNode(StatNode, BlockNode):
+class PyClassDefNode(ClassDefNode):
# A Python class definition.
#
# name EncodedString Name of the class
self.dict.generate_disposal_code(code)
-class CClassDefNode(StatNode, BlockNode):
+class CClassDefNode(ClassDefNode):
# An extension type definition.
#
# visibility 'private' or 'public' or 'extern'
self.visitchildren(node)
return node
+class MarkClosureNode(VisitorTransform):
+
+ needs_closure = False
+
+ def visit_FuncDefNode(self, node):
+ self.needs_closure = False
+ self.visitchildren(node)
+ node.needs_closure = self.needs_closure
+ self.needs_closure = True
+ return node
+
+ def visit_ClassDefNode(self, node):
+ self.visitchildren(node)
+ self.needs_closure = True
+ return node
+
+ def visit_YieldNode(self, node):
+ self.needs_closure = True
+
+ def visit_Node(self, node):
+ self.visitchildren(node)
+ return node
+