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


Groups > comp.lang.python > #81954

Re: Style question: Importing modules from packages - 'from' vs 'as'

Path csiph.com!usenet.pasdenom.info!gegeweb.org!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed4a.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <rosuav@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.003
X-Spam-Evidence '*H*': 0.99; '*S*': 0.00; "subject:' ": 0.07; '3.0,': 0.09; 'subject:modules': 0.09; 'subject:question': 0.10; 'cc:addr :python-list': 0.11; 'python': 0.11; '2.7': 0.14; '"in': 0.16; '__future__': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'hmm.': 0.16; 'imports': 0.16; 'otoh,': 0.16; 'statement.': 0.16; 'sure.': 0.16; 'wrote:': 0.18; 'module': 0.19; 'seems': 0.21; 'saying': 0.22; 'cc:addr:python.org': 0.22; 'interpret': 0.24; 'fine': 0.24; 'cc:2**0': 0.24; 'header:In- Reply-To:1': 0.27; 'am,': 0.29; 'dec': 0.30; 'relative': 0.30; 'statement': 0.30; 'message-id:@mail.gmail.com': 0.30; "i'm": 0.30; 'implicit': 0.31; 'fri,': 0.33; 'subject:from': 0.34; 'but': 0.35; 'received:google.com': 0.35; 'there': 0.35; 'transition': 0.36; 'how': 0.40; 'even': 0.60; 'read': 0.60; "you're": 0.61; 'became': 0.64; 'between': 0.67; 'believe': 0.68; 'to:none': 0.92
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:cc :content-type; bh=hOAXHKAnJrWKWkWr4XDm7pHkUHfky66+tbb5YIdYlTY=; b=vE010naw7IJpouBZE2rnUTkgSnhNy5E4DyQeFZXcuERPxh9UnKeENM2delaULkYnJH pM5hEkuMl764Eboc30erxVWuKLLR6c/4tUEko7AewVylvWENTaZOO7BPo1SgO9eMca0V AhvtyOIRNHqID8GoWowF0+r8E6hiJpcepdjaQ4n/Jqvugjsn0rF6bJ8kDcAGFWiYfuty C9oqW0Q7SV5VfXO1g2kqVxWxCCPTeloLcDDUET1c/aEPyKU37G99bfJvfetP7TMkFbTY qBaakkEX6SGWQL2ohxoPYAWyV/v9ybTIDVnqwYLjhjxU+f7sB0VSkCsOQX9crFYrU/Ca +bIw==
MIME-Version 1.0
X-Received by 10.107.134.39 with SMTP id i39mr11826585iod.53.1417731865851; Thu, 04 Dec 2014 14:24:25 -0800 (PST)
In-Reply-To <m5qm45$h75$1@ger.gmane.org>
References <CAPTjJmo1-QCgcbsjKNgH3oN-nm5qjB5GrvCiC6Qc9p+S8cNjpg@mail.gmail.com> <2047880662.4611734.1417714597653.JavaMail.root@sequans.com> <CAPTjJmpgM2n=AdY+8gZ40gqe1S2zfD83Ui-f5SngRYLA3jMtCQ@mail.gmail.com> <m5qhqd$bts$1@ger.gmane.org> <CAPTjJmomvKMBxr0Sq=FtcfDVuUXU9gX6vbzjFdp2VEEk5Qrq1g@mail.gmail.com> <m5qm45$h75$1@ger.gmane.org>
Date Fri, 5 Dec 2014 09:24:25 +1100
Subject Re: Style question: Importing modules from packages - 'from' vs 'as'
From Chris Angelico <rosuav@gmail.com>
Cc "python-list@python.org" <python-list@python.org>
Content-Type text/plain; charset=UTF-8
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.16592.1417731875.18130.python-list@python.org> (permalink)
Lines 13
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1417731875 news.xs4all.nl 2848 [2001:888:2000:d::a6]:45953
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:81954

Show key headers only | View raw


On Fri, Dec 5, 2014 at 9:10 AM, Wolfgang Maier
<wolfgang.maier@biologie.uni-freiburg.de> wrote:
> which I read as there has been a stepwise transition between 2.5 and 2.7 so
> that 2.7 now behaves like Python 3 even without the __future__ statement.
> OTOH, I believe you, of course, if you're saying implicit relative imports
> are working just fine in 2.7, but then how to interpret the "In Python 2.7
> the __future__ statement is not needed." above ?

Hmm. To be honest, I'm not sure. The Python 2.7 __future__ module
claims that absolute_import became standard in 3.0, not 2.7, which
seems to conflict with what you're seeing.

ChrisA

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


Thread

Re: Style question: Importing modules from packages - 'from' vs 'as' Chris Angelico <rosuav@gmail.com> - 2014-12-05 09:24 +1100

csiph-web