This ensures that any false value (for example, None , '' , 0 , False , [] , ...) in the dict will turn into None . those. if you have
d = {'title': False}
then
d.get('title', None) # False d.get('title', None) or None # None
Is there a practical precedent for this debatable, but there is definitely a subtle difference ...
Also note that you can simplify this:
d.get('title') or None
since d.get by default returns None if the item is not found.
mgilson
source share