Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #70388

Re: module and namespace

Date 2014-04-19 16:49 +0200
From Egon Frerich <egon@frerich.eu>
Subject Re: module and namespace
References <trinity-686a7357-6132-4804-aab8-70731c38aac1-1397815627436@3capp-gmx-bs29> <lir3eq$q15$1@ger.gmane.org>
Newsgroups comp.lang.python
Message-ID <mailman.9362.1397919015.18130.python-list@python.org> (permalink)

Show all headers | View raw


[Multipart message — attachments visible in raw view] - view raw

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


Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: module and namespace Egon Frerich <egon@frerich.eu> - 2014-04-19 16:49 +0200

csiph-web