MCPcopy Create free account
hub / github.com/python-hyper/uritemplate / discard

Method discard

uritemplate/orderedset.py:49–55  ·  view source on GitHub ↗
(self, key: str)

Source from the content-addressed store, hash-verified

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.

Callers 1

popMethod · 0.95

Calls 1

popMethod · 0.80

Tested by

no test coverage detected