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