[Import-SIG] PEP 382: Partial packages

P.J. Eby pje at telecommunity.com
Tue Jul 12 01:06:58 CEST 2011


At 08:53 AM 7/11/2011 +0200, Martin v. Löwis wrote:
>- in PHP, namespaces and files are completely unrelated:
>   http://php.net/manual/en/language.namespaces.php
>   The files you want to use are passed to "include". include takes
>   file names, not namespace names. Only after including the file,
>   PHP finds out what namespace the stuff is in it imported.

I mean that in PHP, when you 'include "foo/bar"', the entire include 
path is searched for foo/bar.  PHP namespaces are a new feature.


>*All* Python packages are namespaces. What specific property of the
>package mechanism do you mean when you say "namespacey"?

The feature that allows a "package" to be merely an agglomeration of 
child elements, rather than an entity in itself.  If you read my 
draft proposal, it quotes Jim Fulton's original coining of the term 
"namespace" package, as a contrast to what he called a "module" package.

That is, some packages are self-contained entities, and others merely 
serve as a gathering place (namespace) for distinct entities.

This is not a property of packages themselves, but of the user's 
intention in organizing the package.  The other languages I mention 
all support the "namespace-only" use case better by allowing segments 
to be merged along their include/import paths.



More information about the Import-SIG mailing list