News for hackers. Stuff that matters.
Re:WTF Python: Exploring and understanding Python through su... by GoblinSlayer on Friday February 12, 2021 @02:19AM (#26111389)
I mean why not use == for everything?
Re:WTF Python: Exploring and understanding Python through su... by Vaphell on Friday February 12, 2021 @10:01AM (#26114336)
1. it's a slower check, just like equals() intended for value equality is slower than reference equality == in java.

2. 1 == True and 0 == False, as booleans subclass the int type. On the other hand is distingushes between 1 and True, and 0 and False respectively.