MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / extractPythonReExports

Function extractPythonReExports

src/resolution/import-resolver.ts:2723–2732  ·  view source on GitHub ↗

* A Python module's imports ARE its re-exports: `from .impl import foo` makes * `foo` an attribute of the module, which is exactly how a package * `__init__.py` publishes its API. Chased only after a direct lookup misses, * with the shared cycle guard and depth cap.

(content: string)

Source from the content-addressed store, hash-verified

2721 * with the shared cycle guard and depth cap.
2722 */
2723function extractPythonReExports(content: string): ReExport[] {
2724 const out: ReExport[] = [];
2725 for (const { source, names, star } of pythonFromImports(stripCommentsForRegex(content, 'python'))) {
2726 if (star) out.push({ kind: 'wildcard', source });
2727 for (const { name, alias } of names) {
2728 out.push({ kind: 'named', exportedName: alias, originalName: name, source });
2729 }
2730 }
2731 return out;
2732}
2733
2734/**
2735 * Resolve a reference using import mappings

Callers 1

extractReExportsFunction · 0.85

Calls 3

stripCommentsForRegexFunction · 0.90
pythonFromImportsFunction · 0.85
pushMethod · 0.80

Tested by

no test coverage detected