summaryrefslogtreecommitdiff
path: root/docs/ref
diff options
context:
space:
mode:
authorPreston Timmons <prestontimmons@gmail.com>2015-03-11 11:00:17 -0500
committerTim Graham <timograham@gmail.com>2015-03-16 13:13:02 -0400
commit388e79e9fcbf689d5708134534e55d176cfbcee3 (patch)
tree8a0e1ae3570f4f3ca59ed4cfa55c7e747cd3dba5 /docs/ref
parent4d9414098bd98aacd241827a01f6ad2dff71f113 (diff)
Fixed #24493 -- Added BaseContext.setdefault()
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