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

Function extractPythonReExports

src/resolution/import-resolver.ts:2636–2645  ·  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

2634 * with the shared cycle guard and depth cap.
2635 */
2636function extractPythonReExports(content: string): ReExport[] {
2637 const out: ReExport[] = [];
2638 for (const { source, names, star } of pythonFromImports(stripCommentsForRegex(content, 'python'))) {
2639 if (star) out.push({ kind: 'wildcard', source });
2640 for (const { name, alias } of names) {
2641 out.push({ kind: 'named', exportedName: alias, originalName: name, source });
2642 }
2643 }
2644 return out;
2645}
2646
2647/**
2648 * 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