I recently found out that the following snippet:
d = {1:"one" , 2:"two"}
id1 = id(d)
del(d)
d = {1:"one" , 2:"two"}
id2 = id(d)
print(id1==id2)
If it's executed via python interpreter (e.g. using terminal) returns True
and if it's run in the IDLE Shell returns False
.
I am aware that IDLE it's (more or less) an integrated dev environment written in Python , but I would really like to know what happens behind the scenes. Thanks .