Imports & Module Boundaries¶
BetterPy helps you manage Python module boundaries — exporting symbols, enforcing import conventions, and keeping source root prefixes consistent.
Export symbol to target¶
Export symbol to target adds a selected top-level symbol to another module's public API by updating the chosen target file's __all__ export list.
How to invoke: ⌥⏎ / Alt+Enter → "BetterPy: Export symbol to target"
Example¶
How to use it¶
Place the caret on a top-level class, function, or variable and run the intention from Alt+Enter. If more than one export target is available, choose the target module or package __init__.py file when BetterPy asks where the symbol should be exported.
Notes¶
- The intention updates or creates
__all__in the chosen target file. - When the chosen target is a different module, BetterPy also inserts the relative re-export import.
- Targets that already export the symbol are shown as already exported in the chooser.
- It is gated by the Export symbol to target setting.