Y
Hacker News
new
|
ask
|
show
|
jobs
by
connorbrinton
1800 days ago
The best you can do (without doing crazy introspection) is to set `__all__` in `mymod`. It still requires listing everything you want to be exported from `mymod`, but at least you only need to do it once.
Docs:
https://docs.python.org/3/tutorial/modules.html#importing-fr...
1 comments
formerly_proven
1800 days ago
Linters will also complain about importing stuff that's not listed in a module's __all__, so it's overall good API hygiene to have one.
link