[Zope3-dev] Last chance to mess with the source layout of Zope 3
Casey Duncan
casey at zope.com
Fri Feb 13 10:55:08 EST 2004
On Fri, 13 Feb 2004 10:00:11 -0500
Jim Fulton <jim at zope.com> wrote:
[..]
>
> Suppose we have a package foo. I'm inclined to have:
>
> foo:
>
> foo.py
> __init__.py
> configure.zcml
> bar.pt
> spat.pt
>
> and in __init__.py having:
>
> from foo.foo import *
>
> I've been uncomrfortable with repeating names inside packages, and
> I certainly want to avoid clients doing:
>
> from foo.foo import x
Yeah, that bites especially when foo.py contains a function foo() ;^).
The traditional way this is avoided of course is by naming the module
something else (like _foo.py ), which is perhaps not aesthetic but at
least it prevents ambiguity. And clients will see that _foo is supposed
to be a private name.
> but I'm less confortable with heavy __init__.py modules.
Yes, I find they reduce transparency. I'm always surprised when I find
non-initialization code in __init__.py.
-Casey
More information about the Zope3-dev
mailing list