From 388e79e9fcbf689d5708134534e55d176cfbcee3 Mon Sep 17 00:00:00 2001 From: Preston Timmons Date: Wed, 11 Mar 2015 11:00:17 -0500 Subject: Fixed #24493 -- Added BaseContext.setdefault() --- docs/ref/templates/api.txt | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'docs/ref') 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 -- cgit v1.3