[Zope3-dev] packaging conventions note

Guido van Rossum guido@python.org
Fri, 06 Dec 2002 10:28:13 -0500


> I actually like exporting the public names from package scope, e.g.,
> 'from some_package import MyClass' gives you the class itself.  My
> rationale is that the name of the  module declaring the class is
> declared in is an implementation detail *to the clients of the packge.*
> I would find 'from some_package.public import Foo' a reasonable
> compromise with those who prefer to have the package's __init__ be
> empty.

The new naming conventions make it possible once again to stick some
small amount of code in __init__.py that exports the piblic classes.
Previously, this was problematic because the class name and the module
name were often the same.  No more.  So I'm -1 on public.py now --
__init__.py will do just fine.  (As long as you don't use import *. :-)

--Guido van Rossum (home page: http://www.python.org/~guido/)