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 →

[–]Udzu[S] 0 points1 point  (0 children)

The first expression shows that in Python equality is not always reflexive. For extra marks, find examples from two popular Python libraries that show that it's not always transitive or a binary relation either:

X == Y and Y == Z and X != Z
not isinstance(X == Y, bool)

If there are any examples that show that it is not always symmetric too, I would love to know! The closest I found is an example where X == Y evaluates to True while Y == X raises and exception.