5 Mar
2021
5 Mar
'21
10:10 p.m.
On Wed, 3 Mar 2021 at 23:59, Brendan Barnwell
But usually you want to define it at the beginning as a sort of documentation aid ("this is the public API").
This is a little off-topic, but I'm curious, since usually, for public functions and classes, I do __all__ = (Class.__name__, func.__name__, ...) So I have to put it at the end of the module. I do this because if I change the class or function name and I forget to change it in __all__, I get an exception. Furthermore, if there's a module composed by submodules, I usually do from .a import * from .b import * __all__ = a.__all__ + b.__all__ In your opinion, these are good or bad practices?