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


Groups > comp.lang.python > #26752

Re: I thought I understood how import worked...

Path csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!feeder2.ecngs.de!ecngs!feeder.ecngs.de!xlned.com!feeder1.xlned.com!newsfeed.xs4all.nl!newsfeed5.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <prvs=560dc07cf=jeanmichel@sequans.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.037
X-Spam-Evidence '*H*': 0.93; '*S*': 0.00; 'executed': 0.07; 'discriminate': 0.09; 'modules.': 0.09; 'cc:addr:python-list': 0.10; '*can*': 0.16; 'roy': 0.16; 'subject:import': 0.16; 'wrote:': 0.17; 'appears': 0.18; 'module': 0.19; 'import': 0.21; 'cc:2**0': 0.23; 'cc:no real name:2**0': 0.24; 'cc:addr:python.org': 0.25; 'header:In-Reply-To:1': 0.25; 'header :User-Agent:1': 0.26; 'module.': 0.27; 'code': 0.31; 'another': 0.33; 'path': 0.35; 'so,': 0.35; 'bad': 0.37; 'subject:: ': 0.38; 'received:194': 0.61; 'different': 0.63; 'subject:...': 0.63; 'skip:n 10': 0.63; 'smith': 0.71; 'different.': 0.84; 'subject:thought': 0.84; 'careful': 0.91
X-IronPort-AV E=Sophos;i="4.77,732,1336341600"; d="scan'208";a="640879"
X-Virus-Scanned amavisd-new at zimbra.sequans.com
Date Wed, 08 Aug 2012 10:47:14 +0200
From Jean-Michel Pichavant <jeanmichel@sequans.com>
User-Agent Mozilla-Thunderbird 2.0.0.24 (X11/20100328)
MIME-Version 1.0
To Roy Smith <roy@panix.com>
Subject Re: I thought I understood how import worked...
References <roy-B56619.09182407082012@news.panix.com>
In-Reply-To <roy-B56619.09182407082012@news.panix.com>
Content-Type text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding 7bit
Cc python-list@python.org
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.12
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://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 <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.3077.1344415651.4697.python-list@python.org> (permalink)
Lines 11
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1344415651 news.xs4all.nl 6940 [2001:888:2000:d::a6]:46496
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:26752

Show key headers only | View raw


Roy Smith wrote:
> So, it appears that you *can* import a module twice, if you refer to it by 
> different names!  This is surprising.  It means that having non-idempotent code 
> which is executed at import time is a Bad Thing.
>   
Not exactly, it means that one module is different from another if its 
path is different.
That means you need to be extra careful about how you reference a 
module. Content is not used to discriminate modules.

JM

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


Thread

I thought I understood how import worked... Roy Smith <roy@panix.com> - 2012-08-07 09:18 -0400
  Re: I thought I understood how import worked... Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-08-07 13:52 +0000
    Re: I thought I understood how import worked... Roy Smith <roy@panix.com> - 2012-08-07 08:25 -0700
      Re: I thought I understood how import worked... Paul Rubin <no.email@nospam.invalid> - 2012-08-07 08:53 -0700
      Re: I thought I understood how import worked... Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-08-07 17:54 +0000
    Re: I thought I understood how import worked... Cameron Simpson <cs@zip.com.au> - 2012-08-08 08:47 +1000
      Re: I thought I understood how import worked... Roy Smith <roy@panix.com> - 2012-08-07 19:05 -0400
      Re: I thought I understood how import worked... Ben Finney <ben+python@benfinney.id.au> - 2012-08-08 14:14 +1000
        Re: I thought I understood how import worked... Laszlo Nagy <gandalf@shopzeus.com> - 2012-08-08 08:40 +0200
        Re: I thought I understood how import worked... Roy Smith <roy@panix.com> - 2012-08-08 09:12 -0400
        Re: I thought I understood how import worked... Cameron Simpson <cs@zip.com.au> - 2012-08-09 15:52 +1000
  Re: I thought I understood how import worked... Ben Finney <ben+python@benfinney.id.au> - 2012-08-07 23:55 +1000
    Re: I thought I understood how import worked... Laszlo Nagy <gandalf@shopzeus.com> - 2012-08-07 16:14 +0200
    Re: I thought I understood how import worked... Roy Smith <roy@panix.com> - 2012-08-07 08:32 -0700
      Re: I thought I understood how import worked... Terry Reedy <tjreedy@udel.edu> - 2012-08-07 13:15 -0400
  Re: I thought I understood how import worked... Mark Lawrence <breamoreboy@yahoo.co.uk> - 2012-08-07 15:10 +0100
  Re: I thought I understood how import worked... Terry Reedy <tjreedy@udel.edu> - 2012-08-07 12:49 -0400
  Re: I thought I understood how import worked... Mark Lawrence <breamoreboy@yahoo.co.uk> - 2012-08-07 18:44 +0100
  Re: I thought I understood how import worked... Jean-Michel Pichavant <jeanmichel@sequans.com> - 2012-08-08 10:47 +0200

csiph-web