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


Groups > comp.lang.python > #70388

Re: module and namespace

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!goblin2!goblin.stu.neva.ru!newsfeed.xs4all.nl!newsfeed1a.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <egon@frerich.eu>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.009
X-Spam-Evidence '*H*': 0.98; '*S*': 0.00; 'python3': 0.07; 'received:192.168.178': 0.07; 'namespace': 0.09; 'omit': 0.09; 'subject:module': 0.09; 'python': 0.11; '__init__.py': 0.16; 'mkdir': 0.16; 'url:peps': 0.16; 'wrote:': 0.18; 'basically': 0.19; 'header:User-Agent:1': 0.23; 'copied': 0.24; 'merge': 0.24; 'package.': 0.24; 'url:dev': 0.24; 'header:Received:8': 0.24; 'header:In-Reply-To:1': 0.27; 'allows': 0.31; 'probably': 0.32; 'url:python': 0.33; 'actual': 0.34; 'problem': 0.35; 'thanks': 0.36; 'url:org': 0.36; 'wrong': 0.37; 'to:addr:python-list': 0.38; 'to:addr:python.org': 0.39; 'details.': 0.61; 'places': 0.64; 'advantages': 0.68; 'received:info': 0.72; 'touch': 0.74
X-Virus-Scanned by goneo
X-Spam-Flag NO
X-Spam-Score -2.566
X-Spam-Level
X-Spam-Status No, score=-2.566 tagged_above=-999 tests=[ALL_TRUSTED=-1, AWL=0.334, BAYES_00=-1.9] autolearn=ham
X-Virus-Scanned Debian amavisd-new at freudenberg.ih
Date Sat, 19 Apr 2014 16:49:51 +0200
From Egon Frerich <egon@frerich.eu>
User-Agent Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.4.0
MIME-Version 1.0
To python-list@python.org
Subject Re: module and namespace
References <trinity-686a7357-6132-4804-aab8-70731c38aac1-1397815627436@3capp-gmx-bs29> <lir3eq$q15$1@ger.gmane.org>
In-Reply-To <lir3eq$q15$1@ger.gmane.org>
X-Enigmail-Version 1.5.2
Content-Type multipart/signed; protocol="application/pkcs7-signature"; micalg=sha1; boundary="------------ms000002020408050702010307"
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.9362.1397919015.18130.python-list@python.org> (permalink)
Lines 91
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1397919015 news.xs4all.nl 2930 [2001:888:2000:d::a6]:55942
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:70388

Show key headers only | 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