News for hackers. Stuff that matters.
Re:The Trouble with __all__ by nuttingd on Thursday August 01, 2024 @04:23PM (#41133196)

  import my_module
This is compatible with `__all__` if you have your code broken down into smaller sub-modules and collect them in the main module as follows:

  # my_module/__init__.py
  from .submodule import *
  from .another_submodule import *
Re:The Trouble with __all__ by jph00 on Thursday August 01, 2024 @04:32PM (#41133310)
Yup that's what I do too. Works great. And nbdev auto-generates __all__ so I don't have to think about anything -- it all just works.

(Besides which, when you do have __all__ just regular wildcard imports work well anyway. I've been using them for >10 years without trouble. I think people just repeat the claim that they're a problem without having 1st-hand experience of using them with __all__ correctly.)