Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed4a.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.000 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; "subject:' ": 0.07; 'os.path': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'subject:modules': 0.09; 'subject:question': 0.10; 'python': 0.11; '2.7': 0.14; 'mostly': 0.14; 'imports': 0.16; 'modules.': 0.16; 'received:80.91.229.3': 0.16; 'received:mediaways.net': 0.16; 'received:plane.gmane.org': 0.16; 'received:pool.mediaways.net': 0.16; 'wrote:': 0.18; 'header:User-Agent:1': 0.23; '2.x': 0.24; 'script': 0.25; 'header:X-Complaints-To:1': 0.27; 'header:In- Reply-To:1': 0.27; 'chris': 0.29; 'external': 0.29; 'feature': 0.29; 'relative': 0.30; "i'm": 0.30; 'code': 0.31; 'usually': 0.31; 'implicit': 0.31; 'actual': 0.34; 'subject:from': 0.34; 'etc': 0.35; 'but': 0.35; 'project': 0.37; 'question,': 0.38; 'to:addr:python-list': 0.38; 'sure': 0.39; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'is.': 0.60 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Wolfgang Maier Subject: Re: Style question: Importing modules from packages - 'from' vs 'as' Date: Thu, 04 Dec 2014 21:56:44 +0100 References: <2047880662.4611734.1417714597653.JavaMail.root@sequans.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: frbg-5f7310fe.pool.mediaways.net User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.3.0 In-Reply-To: X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 13 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1417726622 news.xs4all.nl 2845 [2001:888:2000:d::a6]:57011 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:81950 On 04.12.2014 19:05, Chris Angelico wrote: > > With os.path it definitely is. With the actual code in question, it's > a Python 2.7 project that mostly uses relative imports - inside > package.module1 is "import module2" etc - and I was writing an > external script that calls on one of the modules. What ? I'm usually thinking Python 3 not 2 and I'm never sure which Python 2.x has backported which feature of 3, but I thought implicit relative imports like you seem to describe are not working in 2.7 ? Wolfgang