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

Function is_stub_package_file

mypy/util.py:902–906  ·  view source on GitHub ↗
(file: str)

Source from the content-addressed store, hash-verified

900
901
902def is_stub_package_file(file: str) -> bool:
903 # Use hacky heuristics to check whether file is part of a PEP 561 stub package.
904 if not file.endswith(".pyi"):
905 return False
906 return any(component.endswith("-stubs") for component in os.path.split(os.path.abspath(file)))
907
908
909def unnamed_function(name: str | None) -> bool:

Callers 1

__init__Method · 0.90

Calls 3

anyFunction · 0.85
splitMethod · 0.80
endswithMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…