Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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...



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.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: