[python/zh-cn] Empty tuple is also False (#4297)

This commit is contained in:
Harukawa Sayaka 2022-01-02 20:04:14 +08:00 committed by GitHub
parent fd3b5cf629
commit 93af05dc04
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -129,12 +129,13 @@ None # => None
"etc" is None # => False
None is None # => True
# None0空字符串空列表空字典都算是False
# None0空字符串空列表空字典,空元组都算是False
# 所有其他值都是True
bool(0) # => False
bool("") # => False
bool([]) # => False
bool({}) # => False
bool(()) # => False
####################################################