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

Function is_stdlib_file

mypy/util.py:890–899  ·  view source on GitHub ↗
(typeshed_dir: str | None, file: str)

Source from the content-addressed store, hash-verified

888
889
890def is_stdlib_file(typeshed_dir: str | None, file: str) -> bool:
891 if "stdlib" not in file:
892 # Fast path
893 return False
894 typeshed_dir = typeshed_dir if typeshed_dir is not None else TYPESHED_DIR
895 stdlib_dir = os.path.join(typeshed_dir, "stdlib")
896 try:
897 return os.path.commonpath((stdlib_dir, os.path.abspath(file))) == stdlib_dir
898 except ValueError: # Different drives on Windows
899 return False
900
901
902def is_stub_package_file(file: str) -> bool:

Callers 1

update_moduleMethod · 0.90

Calls 1

joinMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…