On 3/3/21 2:17 PM, Brendan Barnwell wrote:
[...] usually you want to define [__all__] at the beginning as a sort of
documentation
aid ("this is the public API").
That is its purpose. :-)
I do think something like __exclude_all__ would be handy. It can be annoying
to have
to define __all__ just to exclude a few things.
Exclude a few things from what? *-imports? If you're using *-imports that
often you are already courting confusion (where did that name come from? why
is this name not that function?).
I maintain a handful of libraries, all with `__all__`, and only one them is
designed to be used with `from ... import *`.
The presence or absence of `__all__` has no bearing on named imports. `from
blahblah import _xyz` will work in either case.
--
~Ethan~
_______________________________________________
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at
https://mail.python.org/archives/list/[email protected]/message/4LLOJWIAMUGYPOTA6GPQ3SLRT7HOSSHV/
Code of Conduct: http://python.org/psf/codeofconduct/