You weren't necessarily wrong, but the fact that these integers are fixed objects means that not all integers 'behave' the same. I should have been a bit more explicit in my response.You wrote that with integers everything would behave as expected, but it's not, because of these 262 fixed integer objects. Situations where this is a problem might be rare, but the use of the 'is' operator is certainly an issue.
def set_a(a=257):
return aa1=set_a()
a2=set_a()
print(a1)
print(a2)
print(a1==a2)
print(a1 is a2)257
257
True
True <== this makes sense, because a=257 is evaluated on startupa5=set_a(300)
a6=set_a(300)
print(a5)
print(a6)
print(a5==a6)
print(a5 is a6)300
300
True
False <== that's what I would intuitively expecta3=set_a(42)
a4=set_a(42)
print(a3)
print(a4)
print(a3==a4)
print(a3 is a4)42
42
True
True <== that is unexpected
As said, not necessarily wrong, but certainly an issue that might be number 8 on your list of things to be careful with.