In the following python script, why the second assert goes through (i.e., when adding 0 to 257 and stores the result in y, then x and y become different objects)? Thanks!
x = 257
y = 257
assert x is y
x = 257
y = 257 + 0
assert x is not y
isto check for equality ... basically ever ... it is litterally the memory location variable ... python prestores a small number of constants that will just happen to work in some cases ... - Joran Beasleyisseems to work strangely sometimes! stackoverflow.com/questions/132988/… - Peter Wang