A dictionary with ordered keys (first-in last-out).
(self, items=[])
| 176 | class odict(dict): |
| 177 | |
| 178 | def __init__(self, items=[]): |
| 179 | """ A dictionary with ordered keys (first-in last-out). |
| 180 | """ |
| 181 | dict.__init__(self) |
| 182 | self._o = [] # List of ordered keys. |
| 183 | if isinstance(items, dict): |
| 184 | items = reversed(items.items()) |
| 185 | for k, v in items: |
| 186 | self.__setitem__(k, v) |
| 187 | |
| 188 | @classmethod |
| 189 | def fromkeys(cls, keys=[], v=None): |
nothing calls this directly
no test coverage detected