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

Method add

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

Source from the content-addressed store, hash-verified

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

Callers 1

__init__Method · 0.80

Calls 1

LinkClass · 0.85

Tested by

no test coverage detected