mirror of
https://github.com/adambard/learnxinyminutes-docs.git
synced 2025-01-17 13:38:38 +01:00
Add sets to empty things that are false
This commit is contained in:
parent
ae7233323b
commit
adc474c4c9
@ -153,13 +153,14 @@ None # => None
|
|||||||
"etc" is None # => False
|
"etc" is None # => False
|
||||||
None is None # => True
|
None is None # => True
|
||||||
|
|
||||||
# None, 0, and empty strings/lists/dicts/tuples all evaluate to False.
|
# None, 0, and empty strings/lists/dicts/tuples/sets all evaluate to False.
|
||||||
# All other values are True
|
# All other values are True
|
||||||
bool(0) # => False
|
bool(0) # => False
|
||||||
bool("") # => False
|
bool("") # => False
|
||||||
bool([]) # => False
|
bool([]) # => False
|
||||||
bool({}) # => False
|
bool({}) # => False
|
||||||
bool(()) # => False
|
bool(()) # => False
|
||||||
|
bool(set()) # => False
|
||||||
|
|
||||||
####################################################
|
####################################################
|
||||||
## 2. Variables and Collections
|
## 2. Variables and Collections
|
||||||
|
Loading…
x
Reference in New Issue
Block a user