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


Groups > comp.lang.python > #66449

Re: Absolute imports?

Path csiph.com!usenet.pasdenom.info!news.albasani.net!news.stack.nl!newsfeed.xs4all.nl!newsfeed2a.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.004
X-Spam-Evidence '*H*': 0.99; '*S*': 0.00; '"this': 0.03; '16,': 0.03; 'default.': 0.09; 'cc:addr:python-list': 0.11; 'python': 0.11; '(3,': 0.16; '0),': 0.16; '1),': 0.16; '__future__': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'imports': 0.16; 'roy': 0.16; 'wrote:': 0.18; '3.0': 0.19; 'feb': 0.22; '>>>': 0.22; 'appears': 0.22; 'import': 0.22; 'cc:addr:python.org': 0.22; 'looks': 0.24; 'cc:2**0': 0.24; 'skip:_ 20': 0.27; 'header:In-Reply-To:1': 0.27; 'am,': 0.29; 'absolute': 0.30; 'relative': 0.30; 'message-id:@mail.gmail.com': 0.30; 'breaking': 0.31; 'controlled': 0.31; 'stuff': 0.32; 'but': 0.35; 'received:google.com': 0.35; 'version': 0.36; 'doing': 0.36; 'subject:?': 0.36; 'rather': 0.38; 'future': 0.60; 'become': 0.64; 'smith': 0.68; 'default': 0.69; 'potentially': 0.81; '(probably': 0.84; '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=yzmIGaVG9MsEZhfMWqfe1ZbJ8LW1XLKdJFK4hPpLOsg=; b=bWe/yBuqGQ4mN/bAl6Za0QSpVMPFJFaWTfzQ2SXoGEYZa324+HD1+HGwtfLQKJuR9i q5axE88iKcam4Cj1aYujDz31ArVZLp3LR5fSH0KE9vvhTjgb2MbjQTRFuM0ok/xYzxPe v95QVLwc0FikH7hD4JwnXAMPjiFiHNmeDm8+AFzxQkIbTWl8LMe21b7nGNQdGkRKqsKl 4dEGTUcgnwKHT4rM/zXjgtdaN1igbiIIXQWDFI37MvmP1la3YYGWacyEWleDW9tq45Yo HfOkFb5Jb1NdjCkDgzVNLA6/85pi/6Xbv+SJsggmav8ujcXIPi1AtnxXcWG9GEyyUeWA bbOw==
MIME-Version 1.0
X-Received by 10.66.129.133 with SMTP id nw5mr15751273pab.98.1392477973841; Sat, 15 Feb 2014 07:26:13 -0800 (PST)
In-Reply-To <roy-34FC23.10062115022014@news.panix.com>
References <roy-34FC23.10062115022014@news.panix.com>
Date Sun, 16 Feb 2014 02:26:13 +1100
Subject Re: Absolute imports?
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.7004.1392477977.18130.python-list@python.org> (permalink)
Lines 17
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1392477977 news.xs4all.nl 2943 [2001:888:2000:d::a6]:49370
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:66449

Show key headers only | View raw


On Sun, Feb 16, 2014 at 2:06 AM, Roy Smith <roy@panix.com> wrote:
> It also says, "This absolute-import behaviour will become the default in
> a future version (probably Python 2.7)", but it appears that 2.7.6 is
> still doing relative by default.
>

Since absolute imports can be controlled with a future directive, you
can check it out via that module:

>>> import __future__
>>> __future__.absolute_import
_Feature((2, 5, 0, 'alpha', 1), (3, 0, 0, 'alpha', 0), 16384)

Looks like it was held over for 3.0 rather than potentially breaking
stuff across 2.6->2.7.

ChrisA

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


Thread

Absolute imports? Roy Smith <roy@panix.com> - 2014-02-15 10:06 -0500
  Re: Absolute imports? Chris Angelico <rosuav@gmail.com> - 2014-02-16 02:26 +1100
  Re: Absolute imports? Peter Otten <__peter__@web.de> - 2014-02-15 16:46 +0100

csiph-web