x = 257 y = 257 print(id(x)) print(id(y)) output: 1846763545888 1846763545888
I was reading about memory allocation. Shouldn’t their IDs be different, since Python creates a new object for integers greater than 257?
submitted by /u/Sulai2
[link] [comments]
r/learnpython x = 257 y = 257 print(id(x)) print(id(y)) output: 1846763545888 1846763545888 I was reading about memory allocation. Shouldn’t their IDs be different, since Python creates a new object for integers greater than 257? submitted by /u/Sulai2 [link] [comments]
x = 257 y = 257 print(id(x)) print(id(y)) output: 1846763545888 1846763545888
I was reading about memory allocation. Shouldn’t their IDs be different, since Python creates a new object for integers greater than 257?
submitted by /u/Sulai2
[link] [comments]