Commit b61ff76e authored by Dag Sverre Seljebotn's avatar Dag Sverre Seljebotn

Fix tuple unpacking bug (related to old temps)

parent 0493847c
...@@ -3003,11 +3003,12 @@ class SequenceNode(NewTempExprNode): ...@@ -3003,11 +3003,12 @@ class SequenceNode(NewTempExprNode):
def allocate_target_temps(self, env, rhs): def allocate_target_temps(self, env, rhs):
self.iterator.allocate_temps(env) self.iterator.allocate_temps(env)
for arg, node in zip(self.args, self.coerced_unpacked_items): for node in self.coerced_unpacked_items:
node.allocate_temps(env) node.allocate_temps(env)
arg.allocate_target_temps(env, None)
#arg.release_target_temp(env) #arg.release_target_temp(env)
#node.release_temp(env) #node.release_temp(env)
for arg in self.args:
arg.allocate_target_temps(env, None)
if rhs: if rhs:
rhs.release_temp(env) rhs.release_temp(env)
self.iterator.release_temp(env) self.iterator.release_temp(env)
......
"""
>>> func()
0 0
0
0
1 1
1
1
2 2
2
2
>>> func2()
"""
def g():
return ((3, 2), 1, 0)
def func2():
(a, b), c, d = g()
def func():
for (a, b),c ,d in zip(zip(range(3), range(3)), range(3), range(3)):
print a, b
print c
print d
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