MCPcopy
hub / github.com/python/mypy / exists

Method exists

mypy/fscache.py:256–263  ·  view source on GitHub ↗
(self, path: str, real_only: bool = False)

Source from the content-addressed store, hash-verified

254 return stat.S_ISDIR(st.st_mode)
255
256 def exists(self, path: str, real_only: bool = False) -> bool:
257 st = self.stat_or_none(path)
258 if st is None:
259 return False
260 if real_only:
261 dirname = os.path.dirname(path)
262 return dirname not in self.fake_package_cache
263 return True
264
265 def read(self, path: str) -> bytes:
266 if path in self.read_cache:

Callers 15

is_pyc_onlyFunction · 0.80
_parse_individual_fileFunction · 0.80
_find_config_fileFunction · 0.80
find_gitignoresFunction · 0.80
parse_allMethod · 0.80
parse_fileMethod · 0.80
_fake_initMethod · 0.80
is_git_repoFunction · 0.80
process_optionsFunction · 0.80

Calls 1

stat_or_noneMethod · 0.95

Tested by 5

run_caseMethod · 0.64
add_fileMethod · 0.64
module_to_pathFunction · 0.64
run_pytest_data_suiteFunction · 0.64