mirror of
https://github.com/adambard/learnxinyminutes-docs.git
synced 2025-08-01 04:20:39 +02:00
[python] == doesn't coerce types; use bool() to demonstrate truthiness instead. Closes #418.
This commit is contained in:
@@ -105,8 +105,8 @@ None is None #=> True
|
||||
|
||||
# None, 0, and empty strings/lists all evaluate to False.
|
||||
# All other values are True
|
||||
0 == False #=> True
|
||||
"" == False #=> True
|
||||
bool(0) #=> False
|
||||
bool("") #=> False
|
||||
|
||||
|
||||
####################################################
|
||||
|
Reference in New Issue
Block a user