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

Function python_executable_prefix

mypy/main.py:315–323  ·  view source on GitHub ↗
(v: str)

Source from the content-addressed store, hash-verified

313
314
315def python_executable_prefix(v: str) -> list[str]:
316 if sys.platform == "win32":
317 # on Windows, all Python executables are named `python`. To handle this, there
318 # is the `py` launcher, which can be passed a version e.g. `py -3.8`, and it will
319 # execute an installed Python 3.8 interpreter. See also:
320 # https://docs.python.org/3/using/windows.html#python-launcher-for-windows
321 return ["py", f"-{v}"]
322 else:
323 return [f"python{v}"]
324
325
326def _python_executable_from_version(python_version: tuple[int, int]) -> str:

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…