You should do normally do
data = collection.get("key") if data is not None: ... else: ....
Wouldn't this be a little cleaner?
data = collection.get("key") if data: ... else: ...
The value in the collection could be the actual value None, that’s different from the collection not having the key.
Wouldn't this be a little cleaner?