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)
| 1062 | __copy__ = copy |
| 1063 | |
| 1064 | def new_child(self, m=None, **kwargs): # like Django's Context.push() |
| 1065 | '''New ChainMap with a new map followed by all previous maps. |
| 1066 | If no map is provided, an empty dict is used. |
| 1067 | Keyword arguments update the map or new empty dict. |
| 1068 | ''' |
| 1069 | if m is None: |
| 1070 | m = kwargs |
| 1071 | elif kwargs: |
| 1072 | m.update(kwargs) |
| 1073 | return self.__class__(m, *self.maps) |
| 1074 | |
| 1075 | @property |
| 1076 | def parents(self): # like Django's Context.pop() |