PEP 382: Namespace Packages

Chris Rebert clp2 at rebertia.com
Thu Apr 2 21:08:36 CEST 2009


On Thu, Apr 2, 2009 at 11:38 AM, Carl Banks <pavlovevidence at gmail.com> wrote:
> On Apr 2, 8:32 am, "Martin v. Löwis" <mar... at v.loewis.de> wrote:
>> I propose the following PEP for inclusion to Python 3.1.
>> Please comment.
>>
>> Regards,
>> Martin
>>
>> Abstract
>> ========
>>
>> Namespace packages are a mechanism for splitting a single Python
>> package across multiple directories on disk. In current Python
>> versions, an algorithm to compute the packages __path__ must be
>> formulated. With the enhancement proposed here, the import machinery
>> itself will construct the list of directories that make up the
>> package.
>
> -0
>
> My main concern is that we'll start seeing all kinds of packages with
> names like:
>
> com.dusinc.sarray.ptookkit.v_1_34_beta.btree.BTree
>
> The current lack of global package namespace effectively prevents
> bureaucratic package naming, which in my mind makes it worth the
> cost.  However, I'd be willing to believe this can be kept under
> control some other way.

Agreed, although I'd be slightly less optimistic on its usage being
kept under control. It seems this goes a bit against the "Flat is
better than nested" principle.
Then again, we also have the "Namespaces are honkingly great"
principle to contend with as well, so it's definitely a balancing act.

Cheers,
Chris

-- 
I have a blog:
http://blog.rebertia.com



More information about the Python-list mailing list