MCPcopy Index your code
hub / github.com/python/cpython / discover

Method discover

Lib/importlib/_bootstrap_external.py:1474–1481  ·  view source on GitHub ↗
(self, parent=None)

Source from the content-addressed store, hash-verified

1472 break
1473
1474 def discover(self, parent=None):
1475 if parent and parent.submodule_search_locations is None:
1476 raise ValueError(f'{parent} is not a package module')
1477
1478 module_prefix = f'{parent.name}.' if parent else ''
1479 for child_name in self._find_children():
1480 if spec := self.find_spec(module_prefix + child_name):
1481 yield spec
1482
1483 def __repr__(self):
1484 return f'FileFinder({self.path!r})'

Callers

nothing calls this directly

Calls 2

_find_childrenMethod · 0.95
find_specMethod · 0.95

Tested by

no test coverage detected