I No Longer Like Python's Boolean Comparisons


1 or 2 # returns 1, not True
(1 or 1) == True # returns False

You spend half your life doing Boolean algebra and then Python just has to come and mess it all up.

Related Posts

Handy command line benchmarking tool

Stan Rogers

Ultimate Hot Couch Guy

Quote on Java Generics

The Programmer Tendency

Figure out undocumented JSON with gron

Mental Model of Dental Hygiene

Book Review: Swastika Night

Is there a name for this construction?

Fun with negation and idioms