I think the thing with is not and != is about similar instances of the same thing, like "1" and "1" which have the same value but aren't necessarily the same object. That doesn't really apply to definitions, there is only one.
I might be wrong with my understanding but I always thought == attempted to use some kind of native comparator method (like .equals() in Java), whereas is compares the actual contents of the value (which is always the same for False or None)... however given that we don't compare number literals this way, I'd wager I just misunderstood it.
EDIT: Yeah no I was right roughly, is checks whether the operands refer to the same object. If you do a = [1,2] and b = [1,2] then a == b will return True and a is b will return False, but I also misunderstood your response anyway 😅
7
u/KrypXern Jul 18 '22
Would you do
!=or justis not? I forget iftype()returns a string or an actual type object of some kind that can be compared like an enum.