[Python-Dev] PEP 382: Namespace Packages

P.J. Eby pje at telecommunity.com
Fri Apr 3 23:23:19 CEST 2009

At 10:15 PM 4/3/2009 +0200, Martin v. Löwis wrote:
>I should make it clear that this is not the case. I envision it to work
>this way: import zope
>- searches sys.path, until finding either a directory zope, or a file
>   zope.{py,pyc,pyd,...}
>- if it is a directory, it checks for .pkg files. If it finds any,
>   it processes them, extending __path__.
>- it *then* checks for __init__.py, taking the first hit anywhere
>   on __path__ (just like any module import would)
>- if no .pkg was found, nor an __init__.py, it proceeds with the next
>   sys.path item (skipping the directory entirely)

Ah, I missed that.  Maybe the above should be added to the PEP to clarify.

More information about the Python-Dev mailing list