Python3 multiple assignment and memory address [duplicate]
问题 This question already has answers here : 'is' operator behaves unexpectedly with non-cached integers (2 answers) Closed 3 years ago . After reading this and this, which are pretty similar to my question, I still cannot understand the following behaviour: a = 257 b = 257 print(a is b) #False a, b = 257, 257 print(a is b) #True When printing id(a) and id(b) I can see that the variables, to which the values were assigned in separate lines, have different ids, whereas with multiple assignment