MCPcopy Index your code
hub / github.com/psf/cachecontrol / DictCache

Class DictCache

cachecontrol/cache.py:35–52  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

33
34
35class DictCache(BaseCache):
36 def __init__(self, init_dict: MutableMapping[str, bytes] | None = None) -> None:
37 self.lock = Lock()
38 self.data = init_dict or {}
39
40 def get(self, key: str) -> bytes | None:
41 return self.data.get(key, None)
42
43 def set(
44 self, key: str, value: bytes, expires: int | datetime | None = None
45 ) -> None:
46 with self.lock:
47 self.data.update({key: value})
48
49 def delete(self, key: str) -> None:
50 with self.lock:
51 if key in self.data:
52 self.data.pop(key)
53
54
55class SeparateBodyBaseCache(BaseCache):

Calls

no outgoing calls

Used in the wild real call sites across dependent graphs

searching dependent graphs…