(self, key: str)
| 38 | return key in self.__map |
| 39 | |
| 40 | def add(self, key: str) -> None: |
| 41 | # Store new key in a new link at the end of the linked list |
| 42 | if key not in self.__map: |
| 43 | self.__map[key] = link = Link() |
| 44 | root = self.__root |
| 45 | last = root.prev |
| 46 | link.prev, link.next, link.key = last, root, key |
| 47 | last.next = root.prev = weakref.proxy(link) |
| 48 | |
| 49 | def discard(self, key: str) -> None: |
| 50 | # Remove an existing item using self.__map to find the link which is |