brownplt / lambda-py

Other
58 stars 10 forks source link

interp dict bug #32

Closed lijunsong closed 11 years ago

lijunsong commented 11 years ago
def f():
   global x
   x += 1
   return x
x = 1
print({10:f(), 11:f()})

report {10: 2, 11: 2} but should be {10: 2, 11: 3}

I am changing the MetaDict to CVal->Address. I will try to fix it.

lijunsong commented 11 years ago

and print({f():f(), f():f()}) should be {3: 2, 5: 4}