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


Groups > comp.lang.python > #44280

Re: improvements sought re. logging across modules

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!eweka.nl!lightspeed.eweka.nl!194.109.133.83.MISMATCH!newsfeed.xs4all.nl!newsfeed4.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <davea@davea.name>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.018
X-Spam-Evidence '*H*': 0.96; '*S*': 0.00; 'subject:modules': 0.09; 'python': 0.11; 'a.py': 0.16; 'b.py': 0.16; 'c.py': 0.16; 'imports': 0.16; 'loops': 0.16; 'modules,': 0.16; 'received:74.208.4.195': 0.16; 'wrote:': 0.18; 'import': 0.22; 'header:User-Agent:1': 0.23; 'module,': 0.24; 'header:In-Reply- To:1': 0.27; 'minor': 0.31; 'another': 0.32; 'problem.': 0.35; 'there': 0.35; 'to:addr:python-list': 0.38; 'pm,': 0.38; 'to:addr:python.org': 0.39; 'break': 0.61; 'subject:. ': 0.67; 'received:74.208': 0.68
Date Wed, 24 Apr 2013 13:55:12 -0400
From Dave Angel <davea@davea.name>
User-Agent Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130329 Thunderbird/17.0.5
MIME-Version 1.0
To python-list@python.org
Subject Re: improvements sought re. logging across modules
References <D9OdncANCNCqk-XMnZ2dnUVZ8sOdnZ2d@brightview.co.uk>
In-Reply-To <D9OdncANCNCqk-XMnZ2dnUVZ8sOdnZ2d@brightview.co.uk>
Content-Type text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding 7bit
X-Provags-ID V02:K0:4vzinWlC7NZexsUTBd/u0MKlXIwu+RXv337KRaKHH9u F5uosU2ZHLRX/lEWefQxnyCK4Sk9jpeWmY8V4LDXZEaHa+Qc/6 b19CKI1FHqpUMTD315P/Z5JtAIczDIDLmpsQvo4vsxDatvBWAU ybske6qaMK9ntmFDUoypavOm+eKaIostylJvNEbhxS0Pqfh93v wSvezdhRCLUb45csURPtds1P4igF4x7wj8h80fNO50hyQLdamC NcyJkcmVRwBG2vYA2BQ73MuWwr1De8uReaxaDfGP97fgrQDqVi zE8naDJuXJWkI1wySDR3k69X1xok4QRq+KpJekVXn4sUiMsXQ= =
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 <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.1027.1366826130.3114.python-list@python.org> (permalink)
Lines 27
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1366826130 news.xs4all.nl 15953 [2001:888:2000:d::a6]:47028
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:44280

Show key headers only | View raw


On 04/24/2013 12:54 PM, The Night Tripper wrote:
> Hi all
> 	I have a small suite of python modules, say
>
> 	A.py
> 	B.py
> 	C.py
>
> which can be invoked in a variety of ways. eg.
>
> 1) A.py is invoked directly; this imports and uses B.py and C.py
>
> 2) B.py is invoked; this imports and uses A.py and C.py
>

Right there you have a potential problem.  Unless you make those imports 
conditional, you have an import loop, which can be a minor problem, or a 
big one.

Whenever you find loops in the import call tree, please break them.  The 
best way is to move the interdependencies into yet another module, and 
let both A and B import that one.



-- 
DaveA

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


Thread

improvements sought re. logging across modules The Night Tripper <jkn+gg@nicorp.co.uk> - 2013-04-24 17:54 +0100
  Re: improvements sought re. logging across modules Fábio Santos <fabiosantosart@gmail.com> - 2013-04-24 18:29 +0100
  Re: improvements sought re. logging across modules Chris “Kwpolska” Warrick <kwpolska@gmail.com> - 2013-04-24 19:43 +0200
  Re: improvements sought re. logging across modules Dave Angel <davea@davea.name> - 2013-04-24 13:55 -0400

csiph-web