What does the second argument of the Session.pop method do in Python Flask?
According to Flask's API their Session
class is a wrapper around a python Dict
. According to the python documentation for dict.pop()
:
pop(key[, default])
If
key
is in the dictionary, remove it and return its value, else returndefault
. Ifdefault
is not given andkey
is not in the dictionary, aKeyError
is raised.
In this case the tutorial asks you to pass in None
as the default
value.