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


Groups > comp.lang.python > #104225

Re: How to get which attribute causes the AttributeError except inspecting strings?

Path csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail
From Tim Golden <mail@timgolden.me.uk>
Newsgroups comp.lang.python
Subject Re: How to get which attribute causes the AttributeError except inspecting strings?
Date Mon, 7 Mar 2016 16:38:09 +0000
Lines 20
Message-ID <mailman.27.1457368693.10335.python-list@python.org> (permalink)
References <be90a047-38ea-4108-adb8-17fd7483fee5@googlegroups.com> <mailman.15.1457347821.10335.python-list@python.org> <7915b82e-12f4-4652-999e-a1cfaca717b6@googlegroups.com>
Mime-Version 1.0
Content-Type text/plain; charset=windows-1252
Content-Transfer-Encoding 7bit
X-Trace news.uni-berlin.de SrmVowOCO7Pzylh7BAc+6Q+oCfnzI4KcTnb8pBBBr8ag==
Return-Path <mail@timgolden.me.uk>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.025
X-Spam-Evidence '*H*': 0.95; '*S*': 0.00; 'seemed': 0.07; 'subject:How': 0.09; 'chime': 0.09; 'issue:': 0.09; 'raised,': 0.09; 'subject:which': 0.09; 'exception': 0.13; 'subject: \n ': 0.15; "can't.": 0.16; 'from:addr:timgolden.me.uk': 0.16; 'from:name:tim golden': 0.16; 'message-id:@timgolden.me.uk': 0.16; 'received:74.55.86': 0.16; 'received:74.55.86.74': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'received:smtp.webfaction.com': 0.16; 'received:webfaction.com': 0.16; 'tjg': 0.16; 'wrote:': 0.16; 'string': 0.17; 'attribute': 0.18; 'to:2**1': 0.21; 'seems': 0.23; 'header:In-Reply-To:1': 0.24; 'discussion': 0.24; 'url:bugs': 0.24; 'header:User-Agent:1': 0.26; 'inspect': 0.29; 'url:python': 0.33; 'raised': 0.33; 'involving': 0.35; 'but': 0.36; 'there': 0.36; 'url:org': 0.36; 'possible': 0.36; '(and': 0.36; 'to:addr:python-list': 0.36; 'subject:?': 0.36; 'subject:: ': 0.37; 'really': 0.37; 'things': 0.38; 'hi,': 0.38; 'subject:the': 0.39; 'received:192': 0.39; 'to:addr:python.org': 0.40; 'some': 0.40; 'hope': 0.61; 'caused': 0.61; 'bring': 0.62; 'back': 0.62; 'charset:windows-1252': 0.62; 'subject:skip:A 10': 0.63; 'more': 0.63; 'interest': 0.64; 'forward': 0.66; 'life': 0.67; 'from:addr:mail': 0.70; 'directly.': 0.76; 'interest.': 0.79; 'introduce': 0.79; 'subject:get': 0.81; 'movement.': 0.84; 'revive': 0.84; 'zhang': 0.84
User-Agent Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.0.1
In-Reply-To <7915b82e-12f4-4652-999e-a1cfaca717b6@googlegroups.com>
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.21
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>
Xref csiph.com comp.lang.python:104225

Show key headers only | View raw


On 07/03/2016 16:25, Xiang Zhang wrote:
> Hi,
> 
> I know I can get the attribute name in some way, but since I just
> want the attribute name when an AttributeError caused by it raised, I
> really don't want to inspect the string or introduce one more layer
> over getattr. I hope I can get the attribute which causes the
> exception from the AttributeError raised directly. But it seems I
> can't.
> 

As things stand, you can't. But if you were to chime in on this issue:

  https://bugs.python.org/issue18156

then you might bring discussion there back to life again and see some
forward movement. There seemed to be a consensus (and involving some
active developers) so it's possible that new interest might revive interest.

TJG

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


Thread

How to get which attribute causes the AttributeError except inspecting strings? ZhangXiang <zhangyangyu0614@gmail.com> - 2016-03-07 00:46 -0800
  Re: How to get which attribute causes the AttributeError except inspecting strings? Peter Otten <__peter__@web.de> - 2016-03-07 10:48 +0100
    Re: How to get which attribute causes the AttributeError except inspecting strings? Xiang Zhang <zhangyangyu0614@gmail.com> - 2016-03-07 02:15 -0800
  Re: How to get which attribute causes the AttributeError except inspecting strings? jmp <jeanmichel@sequans.com> - 2016-03-07 11:50 +0100
    Re: How to get which attribute causes the AttributeError except inspecting strings? Xiang Zhang <zhangyangyu0614@gmail.com> - 2016-03-07 08:25 -0800
      Re: How to get which attribute causes the AttributeError except inspecting strings? Tim Golden <mail@timgolden.me.uk> - 2016-03-07 16:38 +0000
        Re: How to get which attribute causes the AttributeError except inspecting strings? Xiang Zhang <zhangyangyu0614@gmail.com> - 2016-03-07 09:01 -0800
      Re: How to get which attribute causes the AttributeError except inspecting strings? Mark Lawrence <breamoreboy@yahoo.co.uk> - 2016-03-07 17:26 +0000

csiph-web