PostParse(self),
_specific_post_parse,
InterpretCompilerDirectives(self, self.compiler_directives),
- _align_function_definitions,
MarkClosureVisitor(self),
+ _align_function_definitions,
ConstantFolding(),
FlattenInListTransform(),
WithTransform(self),
error(pxd_def.pos, "previous declaration here")
return None
node = node.as_cfunction(pxd_def)
- elif self.scope.is_module_scope and self.directives['auto_cpdef']:
+ elif (self.scope.is_module_scope
+ and not node.needs_closure
+ and self.directives['auto_cpdef']):
node = node.as_cfunction(scope=self.scope)
- # Enable this when internal def functions are allowed.
+ # Enable this when nested cdef functions are allowed.
# self.visitchildren(node)
return node