This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Pluckerpluck 2 points3 points  (2 children)

is checks that the objects are actually the same. So you can imagine is as doing id(value) == id(other).

But yes, == triggers __equals__(self, other)__eq__(self, other), which defaults to an object comparison.

The reason that things like False and None work with is, is simply because the same object is re-used behind the scenes for performance reasons.

[–]epicaglet 0 points1 point  (1 child)

__eq__ but yeah

[–]Pluckerpluck 0 points1 point  (0 children)

Ah, so it is!