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: 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: References: From: Ian Kelly 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: 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 On Thu, Feb 9, 2012 at 11:53 AM, HoneyMonster 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.