Adds a new item from the given (key, value)-tuple. If the key exists, pushes the updated item to the head of the dict.
(self, (k, v))
| 190 | return cls((k, v) for k in keys) |
| 191 | |
| 192 | def push(self, (k, v)): |
| 193 | """ Adds a new item from the given (key, value)-tuple. |
| 194 | If the key exists, pushes the updated item to the head of the dict. |
| 195 | """ |
| 196 | if k in self: |
| 197 | self.__delitem__(k) |
| 198 | self.__setitem__(k, v) |
| 199 | append = push |
| 200 | |
| 201 | def __iter__(self): |