(modules: dict[str, MypyFile], typ: CallableType)
| 3347 | |
| 3348 | |
| 3349 | def 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. |
no test coverage detected
searching dependent graphs…