Based on this answer, we know that Python returns a reference to integers from -5 <= x <= 256. When I enter the following into an interpreter, I get the expected results:
big_num_1 = 1000
big_num_2 = 1000
print(big_num_1 == big_num_2, big_num_1 is big_num_2)
Which gives me:
True False
But if i save it inside the file myFile
and simply do an import:
import myFile
It always give me the following output:
True True
Does Python handle these references differently when not run from an interpreter?