Fixed #24493 -- Added BaseContext.setdefault()

This commit is contained in:
Preston Timmons 2015-03-11 11:00:17 -05:00 committed by Tim Graham
parent 4d9414098b
commit 388e79e9fc
4 changed files with 28 additions and 0 deletions

View file

@ -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