On Sunday, 16 June 2019 at 01:36:38 UTC, Timon Gehr wrote:
It's a bug. It's memory corruption. Different objects with
lifetimes use the same memory location.
Okay. Seen that way, it is clear to me why it's a bug.
No, it's not the same. Python has no sensible notion of
>>> for i in range(3): pass
I got confused by this Python behavior:
ls = 
for i in range(0, 5):
ls.append(lambda x: x + i)
for fun in ls: