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


Groups > comp.lang.python > #71542

RE: Exception problem with module

Path csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!rt.uk.eu.org!newsfeed.xs4all.nl!newsfeed2.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <jcasale@activenetwerx.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.077
X-Spam-Evidence '*H*': 0.85; '*S*': 0.00; 'advocate': 0.07; 'spelled': 0.09; 'subject:module': 0.09; 'attribute,': 0.16; 'received:172.18.0': 0.16; 'written': 0.21; 'import': 0.22; 'module,': 0.24; "shouldn't": 0.24; 'subject:problem': 0.24; 'fine': 0.24; 'header:Received:8': 0.24; 'header:In-Reply-To:1': 0.27; 'code': 0.31; "skip:' 10": 0.31; 'really,': 0.31; 'subject:with': 0.35; 'but': 0.35; 'charset:us-ascii': 0.36; "i'll": 0.36; 'should': 0.36; 'to:addr:python-list': 0.38; 'issue': 0.38; 'sure': 0.39; 'to:addr:python.org': 0.39; 'even': 0.60; 'received:unknown': 0.61; 'back': 0.62; "you've": 0.63; 'user,': 0.69; 'was...': 0.84; 'directly.': 0.95
X-Cloudmark-SP-Filtered true
X-Cloudmark-SP-Result v=1.1 cv=OwXf4AQYS7J10u4+/2kpCX1VHJ+qeA/E1g375LKBsDQ= c=1 sm=1 a=eJEzyRHMBusA:10 a=7PYXob_7ZXMA:10 a=AgG5ixNBvo4A:10 a=BLceEmwcHowA:10 a=kj9zAlcOel0A:10 a=xqWC_Br6kY4A:10 a=oNw28mxuUhXRB3mVwYQ4Ag==:17 a=TWvgkQcrI-kzm-EbKzEA:9 a=CjuIK1q_8ugA:10 a=HpAAvcLHHh0Zw7uRqdWCyQ==:117
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/simple; d=activenetwerx.com; s=default; t=1400059312; bh=yIekh5BvYlBtvSlvq0fsQK3FhXvVlUPvoXfDADLGeus=; h=From:To:Subject:Date:References:In-Reply-To; b=WAdxA2fZoCG04Pi7vRsqvkY0+KJ7ZxnMXQhRes99XjqOZoK+GS8pYg2ZsTVUcST2/ AS61Rdx1y0/6/4XxJ/Ux9Y/UU3ze9gOO9EnB7MgpEgmtQbzMygCBpQTeweDpJdMCE9 XYm+J3OVPW4BzCnTt98sUqZws1evyo2DDukhWwUo=
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/simple; d=activenetwerx.com; s=default; t=1400059312; bh=yIekh5BvYlBtvSlvq0fsQK3FhXvVlUPvoXfDADLGeus=; h=From:To:Subject:Date:References:In-Reply-To; b=WAdxA2fZoCG04Pi7vRsqvkY0+KJ7ZxnMXQhRes99XjqOZoK+GS8pYg2ZsTVUcST2/ AS61Rdx1y0/6/4XxJ/Ux9Y/UU3ze9gOO9EnB7MgpEgmtQbzMygCBpQTeweDpJdMCE9 XYm+J3OVPW4BzCnTt98sUqZws1evyo2DDukhWwUo=
X-Spam-Checker-Version SpamAssassin 3.3.1 (2010-03-16) on mail.activenetwerx.com
X-Spam-Level
X-Spam-Status No, score=-1.0 required=5.0 tests=ALL_TRUSTED autolearn=ham version=3.3.1
From "Joseph L. Casale" <jcasale@activenetwerx.com>
To "'python-list@python.org'" <python-list@python.org>
Subject RE: Exception problem with module
Thread-Topic Exception problem with module
Thread-Index AQHPbwfaLeIN+SWW90mOr8A0k8UUz5s/zO6A
Date Wed, 14 May 2014 09:21:50 +0000
References <mailman.9975.1400000510.18130.python-list@python.org> <5372b2ae$0$29977$c3e8da3$5496439d@news.astraweb.com>
In-Reply-To <5372b2ae$0$29977$c3e8da3$5496439d@news.astraweb.com>
Accept-Language en-US
Content-Language en-US
X-MS-Has-Attach
X-MS-TNEF-Correlator
x-originating-ip [172.18.0.201]
Content-Type text/plain; charset="us-ascii"
Content-Transfer-Encoding quoted-printable
MIME-Version 1.0
X-Virus-Scanned ClamAV using ClamSMTP
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.9994.1400059319.18130.python-list@python.org> (permalink)
Lines 22
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1400059319 news.xs4all.nl 2854 [2001:888:2000:d::a6]:49775
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:71542

Show key headers only | View raw


> I see that you've solved your immediate problem, but you shouldn't call 
> __setattr__ directly. That should actually be written
>
>     setattr(bar, 'a_new_name', MyError)
>
> But really, since bar is (apparently) a module, and it is *bar itself* 
> setting the attribute, the better way is
>
> a_new_name = MyError
>
> or even 
>
> from module.foo import MyError as a_new_name

Well I am not sure what advantage this has for the user, not my code as
I don't advocate the import to begin with it, its fine spelled as it was from
where it was... I'll look back at this and see if that resolves the issue as it
had manifested.

jlc

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


Thread

Exception problem with module "Joseph L. Casale" <jcasale@activenetwerx.com> - 2014-05-13 16:59 +0000
  Re: Exception problem with module Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-05-14 00:02 +0000
    RE: Exception problem with module "Joseph L. Casale" <jcasale@activenetwerx.com> - 2014-05-14 09:21 +0000
      Re: Exception problem with module Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-05-14 13:08 +0000
        Re: Exception problem with module Chris Angelico <rosuav@gmail.com> - 2014-05-14 23:17 +1000
        RE: Exception problem with module "Joseph L. Casale" <jcasale@activenetwerx.com> - 2014-05-19 23:48 +0000

csiph-web