* 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)
| 2634 | * with the shared cycle guard and depth cap. |
| 2635 | */ |
| 2636 | function 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 |
no test coverage detected