mirror of
https://github.com/adambard/learnxinyminutes-docs.git
synced 2024-12-23 17:41:41 +00: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
|
||||
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
|
||||
bool(0) # => False
|
||||
bool("") # => False
|
||||
bool([]) # => False
|
||||
bool({}) # => False
|
||||
bool(()) # => False
|
||||
bool(0) # => False
|
||||
bool("") # => False
|
||||
bool([]) # => False
|
||||
bool({}) # => False
|
||||
bool(()) # => False
|
||||
bool(set()) # => False
|
||||
|
||||
####################################################
|
||||
## 2. Variables and Collections
|
||||
|
Loading…
Reference in New Issue
Block a user