| 61 | | def update(self, other_dict): |
| 62 | | "Like dict.update(). Pushes an entire dictionary's keys and values onto the context." |
| 63 | | self.dicts = [other_dict] + self.dicts |
| | 61 | def update(self, other_dict, push=True): |
| | 62 | """ |
| | 63 | Similar to dict.update(). Updates the current context's keys and values |
| | 64 | from other_dict. |
| | 65 | |
| | 66 | If push is True, it will push the other_dict dictionary on to the |
| | 67 | context, otherwise the most recent context dictionary will be updated. |
| | 68 | """ |
| | 69 | if push: |
| | 70 | self.dicts = [other_dict] + self.dicts |
| | 71 | else: |
| | 72 | self.dicts[0].update(other_dict) |