jnkle
Re:Python Tips and Tricks, You Haven’t Already Seen
on Monday December 09, 2019 @02:38PM (#21745657)
A couple of interesting capabilities in this post. The section "Controlling What Can Be Imported and What Not" is wrong or misleading though. The dunder __all__ only limits wildcard imports like `from my_module import * `. In your example both `foo` and `bar` can be imported/accessed like `from my_module import foo, bar` or `import my_module; my_module.foo(); my_module.bar()`.
Edit: Also just tried to `import * ` with `_all__ = []` and no AttributeError is raised as is stated. Python 3.7.4