New ChainMap with a new map followed by all previous maps. If no map is provided, an empty dict is used. Keyword arguments update the map or new empty dict.
(self, m=None, **kwargs)
| 1103 | __copy__ = copy |
| 1104 | |
| 1105 | def new_child(self, m=None, **kwargs): # like Django's Context.push() |
| 1106 | '''New ChainMap with a new map followed by all previous maps. |
| 1107 | If no map is provided, an empty dict is used. |
| 1108 | Keyword arguments update the map or new empty dict. |
| 1109 | ''' |
| 1110 | if m is None: |
| 1111 | m = kwargs |
| 1112 | elif kwargs: |
| 1113 | m.update(kwargs) |
| 1114 | return self.__class__(m, *self.maps) |
| 1115 | |
| 1116 | @property |
| 1117 | def parents(self): # like Django's Context.pop() |