diff options
author | Kamil Turek <kamil.turek@hotmail.com> | 2021-03-14 03:15:44 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-14 03:15:44 (GMT) |
commit | 9923df96413a0b480a34ec1d537b66ca0eeb0fdc (patch) | |
tree | 1612d5da49a8ddf65ec81139a79d548786cfc1ea /Doc | |
parent | 9c376bc1c4c8bcddb0bc4196b79ec8c75da494a8 (diff) | |
download | cpython-9923df96413a0b480a34ec1d537b66ca0eeb0fdc.zip cpython-9923df96413a0b480a34ec1d537b66ca0eeb0fdc.tar.gz cpython-9923df96413a0b480a34ec1d537b66ca0eeb0fdc.tar.bz2 |
bpo-43245: Add keyword argument support to ChainMap.new_child() (GH-24788)
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/library/collections.rst | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/Doc/library/collections.rst b/Doc/library/collections.rst index 540db20..723c9da 100644 --- a/Doc/library/collections.rst +++ b/Doc/library/collections.rst @@ -72,19 +72,23 @@ The class can be used to simulate nested scopes and is useful in templating. be modified to change which mappings are searched. The list should always contain at least one mapping. - .. method:: new_child(m=None) + .. method:: new_child(m=None, **kwargs) Returns a new :class:`ChainMap` containing a new map followed by all of the maps in the current instance. If ``m`` is specified, it becomes the new map at the front of the list of mappings; if not specified, an empty dict is used, so that a call to ``d.new_child()`` - is equivalent to: ``ChainMap({}, *d.maps)``. This method is used for - creating subcontexts that can be updated without altering values in any - of the parent mappings. + is equivalent to: ``ChainMap({}, *d.maps)``. If any keyword arguments + are specified, they update passed map or new empty dict. This method + is used for creating subcontexts that can be updated without altering + values in any of the parent mappings. .. versionchanged:: 3.4 The optional ``m`` parameter was added. + .. versionchanged:: 3.10 + Keyword arguments support was added. + .. attribute:: parents Property returning a new :class:`ChainMap` containing all of the maps in |