What are the differences between if query and if query is not None ?
foo = Item.query.filter(...).first()
I always use If too,but I always see some codes If foo is not none,something specials ?
I always use If too,but I always see some codes If foo is not none,something specials ?
No any search results
You already invited:
3 Answers
wincent
Upvotes from: emma
Alex - designer
Upvotes from: emma
control flow statements, the following values are interpreted as false:
False, None, numeric zero of all types, and empty strings and containers
(including strings, tuples, lists, dictionaries, sets and frozensets). All
other values are interpreted as true. (See the __nonzero__()
special method for a way to change this.)
Tony
Upvotes from: