(self, key: str)
| 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 |
| 51 | # then removed by updating the links in the predecessor and successors. |
| 52 | if key in self.__map: |
| 53 | link = self.__map.pop(key) |
| 54 | link.prev.next = link.next |
| 55 | link.next.prev = link.prev |
| 56 | |
| 57 | def __iter__(self) -> t.Generator[str, None, None]: |
| 58 | # Traverse the linked list in order. |