
Brett Cannon wrote:
I agree with Raymond that if the calendar module was following the leading underscore practice (which we should probably encourage all new modules to follow for consistency going forward) then I think the module should be updated to keep the practice going. -Brett
Rather than it being on a case-by-case basis, would it be reasonable to establish a universal standard across stdlib for defining modules as public to apply to older modules as well? I think that it would prove to be quite beneficial to create an explicit definition of what is considered public. If we don't, there is likely to be further confusion on this topic, particularly from users. There would be some overhead cost associated with ensuring that every non-public function is is proceeded by an underscore, but adding public functions to __all__ could safely be automated with something like this (https://bugs.python.org/issue29446#msg287049): __all__ = [name for name, obj in globals().items() if not name.startswith('_') and not isinstance(obj, types.ModuleType)] or a bit more lazily: __all__ = [name for name in globals() if not name.startswith('_')] Personally, I think the benefit of avoiding confusion on this issue and providing consistency to users would far outweigh the cost of implementing it.