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

Method deserialize

mypy/cache.py:158–185  ·  view source on GitHub ↗
(cls, meta: dict[str, Any], data_file: str)

Source from the content-addressed store, hash-verified

156
157 @classmethod
158 def deserialize(cls, meta: dict[str, Any], data_file: str) -> CacheMeta | None:
159 try:
160 return CacheMeta(
161 id=meta["id"],
162 path=meta["path"],
163 mtime=meta["mtime"],
164 size=meta["size"],
165 hash=meta["hash"],
166 dependencies=meta["dependencies"],
167 data_mtime=meta["data_mtime"],
168 data_file=data_file,
169 suppressed=meta["suppressed"],
170 imports_ignored={
171 int(line): codes for line, codes in meta["imports_ignored"].items()
172 },
173 options=meta["options"],
174 suppressed_deps_opts=bytes.fromhex(meta["suppressed_deps_opts"]),
175 dep_prios=meta["dep_prios"],
176 dep_lines=meta["dep_lines"],
177 dep_hashes=[bytes.fromhex(dep) for dep in meta["dep_hashes"]],
178 interface_hash=bytes.fromhex(meta["interface_hash"]),
179 trans_dep_hash=bytes.fromhex(meta["trans_dep_hash"]),
180 version_id=meta["version_id"],
181 ignore_all=meta["ignore_all"],
182 plugin_data=meta["plugin_data"],
183 )
184 except (KeyError, ValueError):
185 return None
186
187 def write(self, data: WriteBuffer) -> None:
188 write_str(data, self.id)

Callers

nothing calls this directly

Calls 3

CacheMetaClass · 0.85
intClass · 0.85
itemsMethod · 0.45

Tested by

no test coverage detected