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

Function stub_distribution_name

mypy/stubinfo.py:4–20  ·  view source on GitHub ↗
(module: str)

Source from the content-addressed store, hash-verified

2
3
4def stub_distribution_name(module: str) -> str | None:
5 top_level = module.split(".", 1)[0]
6
7 dist = non_bundled_packages_flat.get(top_level)
8 if dist:
9 return dist
10
11 if top_level in non_bundled_packages_namespace:
12 namespace = non_bundled_packages_namespace[top_level]
13 components = module.split(".")
14 for i in range(len(components), 0, -1):
15 module = ".".join(components[:i])
16 dist = namespace.get(module)
17 if dist:
18 return dist
19
20 return None
21
22
23# Stubs for these third-party packages used to be shipped with mypy.

Callers 3

_find_moduleMethod · 0.90
module_not_foundFunction · 0.90

Calls 5

rangeClass · 0.85
lenFunction · 0.85
splitMethod · 0.80
getMethod · 0.45
joinMethod · 0.45

Tested by 1

Used in the wild real call sites across dependent graphs

searching dependent graphs…