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


Groups > comp.lang.python > #20096

Re: Apparent "double imports" (was: Naming convention for in-house modules (Newbie question))

Path csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <ian.g.kelly@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.005
X-Spam-Evidence '*H*': 0.99; '*S*': 0.00; 'sys': 0.05; 'imports': 0.07; 'object?': 0.09; 'problem:': 0.09; 'received:mail- lpp01m010-f46.google.com': 0.09; 'subject:modules': 0.09; 'am,': 0.12; 'stored': 0.13; 'subject:was': 0.15; 'subject: \n ': 0.16; 'subject:" (': 0.16; 'subject:Newbie': 0.16; 'subject:question': 0.16; 'wrote:': 0.18; 'header:In-Reply-To:1': 0.22; 'feb': 0.22; 'module': 0.26; 'import': 0.27; 'message-id:@mail.gmail.com': 0.29; 'module.': 0.29; 'problem': 0.29; 'imported': 0.30; 'object.': 0.30; 'os,': 0.30; 'received:209.85.215.46': 0.32; 'thu,': 0.32; 'does': 0.32; 'modules': 0.32; 'object': 0.33; 'to:addr:python-list': 0.35; 'two': 0.36; 'issue': 0.37; 'run': 0.37; 'received:google.com': 0.37; 'received:209.85': 0.38; 'sometimes': 0.38; 'received:209.85.215': 0.39; 'received:209': 0.39; 'subject: (': 0.40; 'to:addr:python.org': 0.40; 'further': 0.64; '11:53': 0.84; 'overhead,': 0.84; 'subject:))': 0.84
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=nQ22VBWXcEVb374+C2OYDjnFLxNGdrs7Wc5pllhwIHI=; b=EBoIrNbiLmtXqmAE2b3l/sBsv/u7T/rYeCyBYGgygMMMjSqE9gBhptC/xX1EsXQtDm WoCLBLVoU/ycBV5R8+fRQ1hTyDshG5IqdKNDUsPty+PTsh/KhvPMY0orMMorFtC7XrYp vOGpsYy1b3AQVQuJsvO1uLphIzDC8nh+7qEvE=
MIME-Version 1.0
In-Reply-To <jh14o2$6j6$1@news.albasani.net>
References <jguajb$mqe$1@news.albasani.net> <jh0jrb$2lb$1@news.univ-fcomte.fr> <mailman.5589.1328798215.27778.python-list@python.org> <jh14o2$6j6$1@news.albasani.net>
From Ian Kelly <ian.g.kelly@gmail.com>
Date Thu, 9 Feb 2012 12:02:03 -0700
Subject Re: Apparent "double imports" (was: Naming convention for in-house modules (Newbie question))
To python-list@python.org
Content-Type text/plain; charset=ISO-8859-1
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.5603.1328814154.27778.python-list@python.org> (permalink)
Lines 10
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1328814155 news.xs4all.nl 6988 [2001:888:2000:d::a6]:46856
X-Complaints-To abuse@xs4all.nl
Xref x330-a1.tempe.blueboxinc.net comp.lang.python:20096

Show key headers only | View raw


On Thu, Feb 9, 2012 at 11:53 AM, HoneyMonster <someone@someplace.invalid> wrote:
> One issue I have run into, which may or may not be a problem: I am
> finding that modules in the in-house "library" package sometimes have to
> import modules like sys and os, which are also imported by the "calling"
> module. Is this a problem or an overhead, or does it just result in two
> names for the same object?

Two names for the same object.  When a module is imported, the module
object is stored in the sys.modules dict.  Further imports of the same
module just return the same module object from sys.modules.

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


Thread

Naming convention for in-house modules (Newbie question) HoneyMonster <someone@someplace.invalid> - 2012-02-08 17:15 +0000
  Re: Naming convention for in-house modules (Newbie question) Chris Rebert <clp2@rebertia.com> - 2012-02-08 09:49 -0800
  Re: Naming convention for in-house modules (Newbie question) Laurent Claessens <moky.math@gmail.com> - 2012-02-09 15:00 +0100
    Re: Naming convention for in-house modules (Newbie question) Arnaud Delobelle <arnodel@gmail.com> - 2012-02-09 14:36 +0000
      Re: Naming convention for in-house modules (Newbie question) Laurent Claessens <moky.math@gmail.com> - 2012-02-09 18:42 +0100
      Apparent "double imports" (was: Naming convention for in-house modules (Newbie question)) HoneyMonster <someone@someplace.invalid> - 2012-02-09 18:53 +0000
        Re: Apparent "double imports" (was: Naming convention for in-house modules (Newbie question)) Ian Kelly <ian.g.kelly@gmail.com> - 2012-02-09 12:02 -0700
          Re: Apparent "double imports" (was: Naming convention for in-house modules (Newbie question)) HoneyMonster <someone@someplace.invalid> - 2012-02-09 19:40 +0000
            Re: Apparent "double imports" Dave Angel <d@davea.name> - 2012-02-09 15:05 -0500
              Re: Apparent "double imports" HoneyMonster <someone@someplace.invalid> - 2012-02-09 21:57 +0000

csiph-web