[Python-Dev] PEP 382: Namespace Packages

Chris Withers chris at simplistix.co.uk
Mon Apr 6 15:00:18 CEST 2009



Martin v. Löwis wrote:
> Chris Withers wrote:
>> Martin v. Löwis wrote:
>>> I propose the following PEP for inclusion to Python 3.1.
>>> Please comment.
>> Would this support the following case:
>>
>> I have a package called mortar, which defines useful stuff:
>>
>> from mortar import content, ...
>>
>> I now want to distribute large optional chunks separately, but ideally
>> so that the following will will work:
>>
>> from mortar.rbd import ...
>> from mortar.zodb import ...
>> from mortar.wsgi import ...
>>
>> Does the PEP support this? 
> 
> That's the primary purpose of the PEP. 

Are you sure?

Does the pep really allow for:

from mortar import content
from mortar.rdb import something

...where 'content' is a function defined in mortar/__init__.py and 
'something' is a function defined in mortar/rdb/__init__.py *and* the 
following are separate distributions on PyPI:

- mortar
- mortar.rdb

...where 'mortar' does not contain 'mortar.rdb'.

 > You can do this today already
> (see the zope package,

No, they have nothing but a (functionally) empty __init__.py in the zope 
package.

cheers,

Chris

-- 
Simplistix - Content Management, Zope & Python Consulting
            - http://www.simplistix.co.uk


More information about the Python-Dev mailing list