11
“ is”运算符对整数的行为异常
Наэтотвопросестьответына 堆栈溢出нарусском:Присваиваниецелых(INT)вПитоне 为什么以下内容在Python中表现异常? >>> a = 256 >>> b = 256 >>> a is b True # This is an expected result >>> a = 257 >>> b = 257 >>> a is b False # What happened here? Why is this False? >>> 257 is 257 True # Yet …