summaryrefslogtreecommitdiff
path: root/docs/ref
diff options
context:
space:
mode:
Diffstat (limited to 'docs/ref')
-rw-r--r--docs/ref/templates/api.txt7
1 files changed, 7 insertions, 0 deletions
diff --git a/docs/ref/templates/api.txt b/docs/ref/templates/api.txt
index 05a6539988..b8e74b75ec 100644
--- a/docs/ref/templates/api.txt
+++ b/docs/ref/templates/api.txt
@@ -420,6 +420,13 @@ dictionary syntax::
Returns the value for ``key`` if ``key`` is in the context, else returns
``otherwise``.
+.. method:: Context.setdefault(key, default=None)
+
+ .. versionadded:: 1.9
+
+ If ``key`` is in the context, returns its value. Otherwise inserts ``key``
+ with a value of ``default`` and returns ``default``.
+
.. method:: Context.pop()
.. method:: Context.push()
.. exception:: ContextPopException