Import question

Andrew Degtiariov andrew.degtiariov at
Mon Feb 8 22:39:42 CET 2010

Those are called namespace packages. Zope and Plone (ab)use them

> extensively. The intended usage is to break up a big, monolithic package
> [0] in parts that can be distributed independently. To implement a
> namespace package, you need an empty file with only these
> lines [1]:
>  from pkgutil import extend_path
> __path__ = extend_path(__path__, __name__)
> But think carefully if you really need namespace packages; they solve a
> specific problem, aren't a general purpose technique. See [2] for a
> discussion.
> [0] Think of a huge behemoth with a "Z O P E" sign on both sides :)
> [1]
> [2]
Hm.. We are using pkg_resources.declare_namespace(__name__) but I think
pkgutil is much better.
And we are using buildout so the omelette might help me. Link [2] very
Thank you, Gabrial.

Andrew Degtiariov
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the Python-list mailing list