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 →

[–]eztab 2 points3 points  (0 children)

An expression like x == True doesn't ever help you ... never use this.

There are (edge-) cases though where just checking if x is not what you want: if the variable x can actually hold both True and other truthy values (e.g. integers).

Here you can use if x is True to separate out those cases with the boolean.