MCPcopy Index your code
hub / github.com/python/mypy / flush

Method flush

mypy/fscache.py:52–63  ·  view source on GitHub ↗

Start another transaction and empty all caches.

(self)

Source from the content-addressed store, hash-verified

50 self.package_root = package_root
51
52 def flush(self) -> None:
53 """Start another transaction and empty all caches."""
54 self.stat_or_none_cache: dict[str, os.stat_result | None] = {}
55
56 self.listdir_cache: dict[str, list[str]] = {}
57 self.listdir_error_cache: dict[str, OSError] = {}
58 self.isfile_case_cache: dict[str, bool] = {}
59 self.exists_case_cache: dict[str, bool] = {}
60 self.read_cache: dict[str, bytes] = {}
61 self.read_error_cache: dict[str, Exception] = {}
62 self.hash_cache: dict[str, str] = {}
63 self.fake_package_cache: set[str] = set()
64
65 def stat_or_none(self, path: str) -> os.stat_result | None:
66 if path in self.stat_or_none_cache:

Callers 2

__init__Method · 0.95
mainFunction · 0.95

Calls 1

setClass · 0.85

Tested by

no test coverage detected