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

Function main

mypy/dmypy/client.py:260–279  ·  view source on GitHub ↗

The code is top-down.

(argv: list[str])

Source from the content-addressed store, hash-verified

258
259
260def main(argv: list[str]) -> None:
261 """The code is top-down."""
262 check_python_version("dmypy")
263
264 # set recursion limit consistent with mypy/main.py
265 sys.setrecursionlimit(RECURSION_LIMIT)
266
267 args = parser.parse_args(argv)
268 if not args.action:
269 parser.print_usage()
270 else:
271 try:
272 args.action(args)
273 except BadStatus as err:
274 fail(err.args[0])
275 except Exception:
276 # We do this explicitly to avoid exceptions percolating up
277 # through mypy.api invocations
278 traceback.print_exc()
279 sys.exit(2)
280
281
282def fail(msg: str) -> NoReturn:

Callers 5

runFunction · 0.90
fFunction · 0.90
console_entryFunction · 0.70
testipc.pyFile · 0.50
testformatter.pyFile · 0.50

Calls 4

check_python_versionFunction · 0.90
print_usageMethod · 0.80
exitMethod · 0.80
failFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…