module and namespace

Egon Frerich egon at frerich.eu
Sat Apr 19 10:49:51 EDT 2014


Am 18.04.2014 13:48, schrieb Peter Otten:
> Egon Frerich wrote:
> 

> 
> Basically Python 3 allows for packages to omit the __init__.py
> 
> $ mkdir aaa
> $ python3 -c'import aaa; print(aaa)'
> <module 'aaa' (namespace)>
> $ touch aaa/__init__.py
> $ python3 -c'import aaa; print(aaa)'
> <module 'aaa' from './aaa/__init__.py'>
> 
> Namespace packages have advantages when you want to merge submodules from 
> multiple places into one package. See 
> <http://legacy.python.org/dev/peps/pep-0420/> for the details.
> 
> Your actual problem is probably that the parent directory for the mptt 
> package is not in your sys.path,


The init-file in the parent directory was copied and had got the wrong
ownership.

Thanks Peter

Egon


-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2385 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://mail.python.org/pipermail/python-list/attachments/20140419/5cc50e3b/attachment.bin>


More information about the Python-list mailing list