[Python-Dev] PEP 382: Namespace Packages

P.J. Eby pje at telecommunity.com
Thu Apr 16 04:45:29 CEST 2009

At 09:59 AM 4/16/2009 +0900, Stephen J. Turnbull wrote:
>I think that for this PEP it's more important to unify
>the various use cases for namespace packages than it is to get rid of
>the .pth files.

Actually, Martin's proposal *does* get rid of the .pth files in 
site-packages, and replaces them with other files inside the 
individual packages.  (Thereby speeding startup times when many 
namespace packages are present but only a few are used.)

So Martin's proposal is a win for performance and even for decreasing 
clutter.  (The same number of special files will be present, but they 
will be moved inside the namespace package directories instead of 
being in the parent directory.)

>AFAICS the only things PJE has said about base packages is that
>   (a) they aren't a universal use case for namespace packages, and
>   (b) he'd like to be able to support them in setuptools, but admits
>       that at present they aren't.

...and that Martin's proposal would actually permit me to do so, 
whereas MAL's proposal would not.

Replacing __init__.py with a __pkg__.py wouldn't change any of the 
tradeoffs for how setuptools handles namespace packages, except to 
add an extra variable to consider (i.e., two filenames to keep track of).

More information about the Python-Dev mailing list