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

Method __init__

mypy/modulefinder.py:183–206  ·  view source on GitHub ↗
(
        self,
        search_paths: SearchPaths,
        fscache: FileSystemCache | None,
        options: Options | None,
        stdlib_py_versions: StdlibVersions | None = None,
        source_set: BuildSourceSet | None = None,
    )

Source from the content-addressed store, hash-verified

181 """
182
183 def __init__(
184 self,
185 search_paths: SearchPaths,
186 fscache: FileSystemCache | None,
187 options: Options | None,
188 stdlib_py_versions: StdlibVersions | None = None,
189 source_set: BuildSourceSet | None = None,
190 ) -> None:
191 self.search_paths = search_paths
192 self.source_set = source_set
193 self.fscache = fscache or FileSystemCache()
194 # Cache for get_toplevel_possibilities:
195 # search_paths -> (toplevel_id -> list(package_dirs))
196 self.initial_components: dict[tuple[str, ...], dict[str, list[str]]] = {}
197 # Cache find_module: id -> result
198 self.results: dict[str, ModuleSearchResult] = {}
199 self.ns_ancestors: dict[str, str] = {}
200 self.options = options
201 custom_typeshed_dir = None
202 if options:
203 custom_typeshed_dir = options.custom_typeshed_dir
204 self.stdlib_py_versions = stdlib_py_versions or load_stdlib_py_versions(
205 custom_typeshed_dir
206 )
207
208 def clear(self) -> None:
209 self.results.clear()

Callers

nothing calls this directly

Calls 2

FileSystemCacheClass · 0.90
load_stdlib_py_versionsFunction · 0.85

Tested by

no test coverage detected