
Raymond Hettinger wrote:
On Jul 13, 2019, at 1:56 PM, Serhiy Storchaka storchaka@gmail.com... wrote: Could we strictly define what is considered a public module interface in Python? The RealDefinition™ is that whatever we include in the docs is public, otherwise not. Beyond that, there is a question of how users can deduce what is public when they run "import somemodule; print(dir(some module))". In some modules, we've been careful to use both all and to use an underscore prefix to indicate private variables and helper functions (collections and random for example). IMO, when a module has shown that care, future maintainers should stick with that practice. The calendar module is an example of where that care was taken for many years and then a recent patch went against that practice.
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