Commit 50570112 authored by Stefan Behnel's avatar Stefan Behnel

merged in Vitek's fix for ticket 668

parents 70a90e81 eaad966e
......@@ -299,6 +299,20 @@ class PostParse(ScopeTrackingTransform):
return assign_node
def _flatten_sequence(self, seq, result):
for arg in seq.args:
if arg.is_sequence_constructor:
self._flatten_sequence(arg, result)
else:
result.append(arg)
return result
def visit_DelStatNode(self, node):
self.visitchildren(node)
node.args = self._flatten_sequence(node, [])
return node
def eliminate_rhs_duplicates(expr_list_list, ref_node_sequence):
"""Replace rhs items by LetRefNodes if they appear more than once.
Creates a sequence of LetRefNodes that set up the required temps
......
......@@ -87,3 +87,12 @@ def del_local(a):
"""
del a
assert a is None # Until we have unbound locals...
def del_seq(a, b, c):
"""
>>> del_seq(1, 2, 3)
"""
del a, (b, c)
assert a is None # Until we have unbound locals...
assert b is None # Until we have unbound locals...
assert c is None # Until we have unbound locals...
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