[Python-Dev] PEP 382: little help for stupid people?

"Martin v. Löwis" martin at v.loewis.de
Sat May 9 10:32:39 EDT 2009


Chris Withers wrote:
> Martin v. Löwis wrote:
>>> So this __init__.py can have code in it? 
>>
>> That's the point, yes.
>>
>>> And base.tar can have other modules and subpackages in it?
>>
>> Certainly, yes.
> 
> Great, when is the PEP due to land in 2.x? ;-)

Most likely, never - it probably will be implemented only after
the last feature release of 2.x was made.

>>> What happens if the base and an addon both define a package called
>>> simplistix.somepackage?
>>
>> Depends on whether simplistix.somepackage is a namespace package
>> (it should). If so, they get merged just as any other namespace
>> package.
> 
> Sorry, I was looking at potential bug cases here. What happens if it's
> not a namespace package?

Then it will be imported as a regular child package.

>>>> Unpack each of them anywhere on sys.path, in any order.
>>> How would this work if base, addon1 and addon2 were eggs managed by
>>> buildout or setuptools?
>>
>> What is a managed egg (i.e. what kind of management does buildout
>> or setuptools apply to it)?
> 
> Sorry, bad wording on my part... I guess I meant more how would
> buildout/setuptools go about installing/uninstalling/etc packages
> thatconform to PEP 382? Would setuptools/buildout need modification or
> would the changes take effect lower down in the stack?

Unfortunately, I don't know precisely what they do, so I don't know
whether any of it needs modification.

All I can say is that if they want to install namespace packages
using the mechanism of PEP 382, they will have to produce the file
layout specified in the PEP.

For distutils (which is the only library in that area that I do know),
I think just installing any .pth files inside a package would be
sufficient.

Regards,
Martin



More information about the Python-list mailing list