Commit 9a9ca635 authored by Vitja Makarov's avatar Vitja Makarov

Add no_assignment_synthesis flag to DefNode

parent 2e3f542d
......@@ -4955,10 +4955,8 @@ class GeneratorExpressionNode(LambdaNode):
binding = False
def analyse_declarations(self, env):
# XXX: dirty hack to disable assignment synthesis
self.def_node.needs_assignment_synthesis = lambda *args, **kwargs: False
self.def_node.no_assignment_synthesis = True
self.def_node.analyse_declarations(env)
#super(GeneratorExpressionNode, self).analyse_declarations(env)
env.add_lambda_def(self.def_node)
def generate_result_code(self, code):
......
......@@ -1892,6 +1892,7 @@ class DefNode(FuncDefNode):
num_required_kw_args = 0
reqd_kw_flags_cname = "0"
is_wrapper = 0
no_assignment_synthesis = 0
decorators = None
return_type_annotation = None
entry = None
......@@ -2227,6 +2228,8 @@ class DefNode(FuncDefNode):
self.synthesize_assignment_node(env)
def needs_assignment_synthesis(self, env, code=None):
if self.no_assignment_synthesis:
return False
# Should enable for module level as well, that will require more testing...
if self.entry.is_anonymous:
return True
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment