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

Class StubSource

mypy/stubgen.py:240–263  ·  view source on GitHub ↗

A single source for stub: can be a Python or C module. A simple extension of BuildSource that also carries the AST and the value of __all__ detected at runtime.

Source from the content-addressed store, hash-verified

238
239
240class StubSource:
241 """A single source for stub: can be a Python or C module.
242
243 A simple extension of BuildSource that also carries the AST and
244 the value of __all__ detected at runtime.
245 """
246
247 def __init__(
248 self, module: str, path: str | None = None, runtime_all: list[str] | None = None
249 ) -> None:
250 self.source = BuildSource(path, module, None)
251 self.runtime_all = runtime_all
252 self.ast: MypyFile | None = None
253
254 def __repr__(self) -> str:
255 return f"StubSource({self.source})"
256
257 @property
258 def module(self) -> str:
259 return self.source.module
260
261 @property
262 def path(self) -> str | None:
263 return self.source.path
264
265
266# What was generated previously in the stub file. We keep track of these to generate

Callers 3

collect_build_targetsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…