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

Function find_defining_module

mypy/messages.py:3349–3361  ·  view source on GitHub ↗
(modules: dict[str, MypyFile], typ: CallableType)

Source from the content-addressed store, hash-verified

3347
3348
3349def find_defining_module(modules: dict[str, MypyFile], typ: CallableType) -> MypyFile | None:
3350 if not typ.definition:
3351 return None
3352 fullname = typ.definition.fullname
3353 if "." in fullname:
3354 for i in range(fullname.count(".")):
3355 module_name = fullname.rsplit(".", i + 1)[0]
3356 try:
3357 return modules[module_name]
3358 except KeyError:
3359 pass
3360 assert False, "Couldn't determine module from CallableType"
3361 return None
3362
3363
3364# For hard-coding suggested missing member alternatives.

Callers 1

note_defined_hereMethod · 0.85

Calls 3

rangeClass · 0.85
rsplitMethod · 0.80
countMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…