(original) (raw)
On 15 Jul 2013 13:46, "Steven D'Aprano" <steve@pearwood.info> wrote:
\>
\> On Mon, Jul 15, 2013 at 10:01:17AM +1000, Cameron Simpson wrote:
\> > On 15Jul2013 09:48, Steven D'Aprano <steve@pearwood.info> wrote:
\>
\> > | I'd go further, and say that no more private modules should be
\> > | accepted for the std lib unless they have a leading underscore. I
\> > | suppose for backwards compatibility reasons, we probably can't go
\> > | through the std lib and rename private modules to make it clear they
\> > | are private, but we don't have to accept new ones without the
\> > | underscore.
\> >
\> > I disagree.
\> >
\> > A private module is a perfectly sane way to implement the internals
\> > of something, especially if it is subject to implementation change
\> > in the future.
\>
\> Of course private modules are sane. I never suggested "no new private
\> modules at all". But putting them in the same namespace as public
\> modules is not, just to save a leading underscore in the file name.
It's not to save a leading underscore - it's to avoid renaming existing packages like pip and idlelib.
Cheers,
Nick.
>
\> You don't even have to use the underscore in your own code:
\>
\> import \_stuff as stuff
\>
\> is allowed, and doesn't make \_stuff.py public since imported modules are
\> considered implementation details by default.
\>
\>
\> --
\> Steven
\> \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_
\> Python-Dev mailing list
\> Python-Dev@python.org
\> http://mail.python.org/mailman/listinfo/python-dev
\> Unsubscribe: http://mail.python.org/mailman/options/python-dev/ncoghlan%40gmail.com