diff --git a/django/contrib/sessions/backends/base.py b/django/contrib/sessions/backends/base.py index 3b24b8d3d70..113f658a48e 100644 --- a/django/contrib/sessions/backends/base.py +++ b/django/contrib/sessions/backends/base.py @@ -58,9 +58,9 @@ class SessionBase(object): def get(self, key, default=None): return self._session.get(key, default) - def pop(self, key, *args): + def pop(self, key, default=None): self.modified = self.modified or key in self._session - return self._session.pop(key, *args) + return self._session.pop(key, default) def setdefault(self, key, value): if key in self._session: diff --git a/docs/topics/http/sessions.txt b/docs/topics/http/sessions.txt index 40faf1870ad..a7d444a4e67 100644 --- a/docs/topics/http/sessions.txt +++ b/docs/topics/http/sessions.txt @@ -205,9 +205,9 @@ You can edit it multiple times. Example: ``fav_color = request.session.get('fav_color', 'red')`` - .. method:: pop(key) + .. method:: pop(key, default=None) - Example: ``fav_color = request.session.pop('fav_color')`` + Example: ``fav_color = request.session.pop('fav_color', 'blue')`` .. method:: keys()