What does the second argument of the Session.pop method do in Python Flask? What does the second argument of the Session.pop method do in Python Flask? flask flask

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 return default. If default is not given and key is not in the dictionary, a KeyError is raised.

In this case the tutorial asks you to pass in None as the default value.