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


Groups > comp.lang.python > #104232

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 Mark Lawrence <breamoreboy@yahoo.co.uk>
Newsgroups comp.lang.python
Subject Re: How to get which attribute causes the AttributeError except inspecting strings?
Date Mon, 7 Mar 2016 17:26:11 +0000
Lines 31
Message-ID <mailman.33.1457371807.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> <56DDAE71.1030100@timgolden.me.uk>
Mime-Version 1.0
Content-Type text/plain; charset=windows-1252; format=flowed
Content-Transfer-Encoding 7bit
X-Trace news.uni-berlin.de gcYHKOXZb74O4YRdqUWNgwons0gkQC7MyWC1yJrCDrRw==
Return-Path <python-python-list@m.gmane.org>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.011
X-Spam-Evidence '*H*': 0.98; '*S*': 0.00; 'from:addr:yahoo.co.uk': 0.05; 'seemed': 0.07; 'subject:How': 0.09; 'chime': 0.09; 'issue:': 0.09; 'raised,': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'subject:which': 0.09; 'exception': 0.13; 'subject: \n ': 0.15; "can't.": 0.16; 'received:80.91.229.3': 0.16; 'received:io': 0.16; 'received:plane.gmane.org': 0.16; 'received:psf.io': 0.16; 'tjg': 0.16; 'wrote:': 0.16; 'string': 0.17; 'attribute': 0.18; 'language': 0.19; 'lawrence': 0.22; 'seems': 0.23; 'thanks,': 0.24; 'tim': 0.24; 'header:In-Reply- To:1': 0.24; 'discussion': 0.24; 'url:bugs': 0.24; 'header:User- Agent:1': 0.26; 'header:X-Complaints-To:1': 0.26; 'inspect': 0.29; 'language.': 0.32; 'url:python': 0.33; 'raised': 0.33; 'involving': 0.35; 'saved': 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; 'received:org': 0.37; 'things': 0.38; 'hi,': 0.38; 'subject:the': 0.39; 'to:addr:python.org': 0.40; 'mark': 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; 'our': 0.64; 'forward': 0.66; 'life': 0.67; 'directly.': 0.76; 'interest.': 0.79; 'introduce': 0.79; 'subject:get': 0.81; 'movement.': 0.84; 'pythonistas,': 0.84; 'revive': 0.84; 'zhang': 0.84
X-Injected-Via-Gmane http://gmane.org/
X-Gmane-NNTP-Posting-Host 80.234.129.0
User-Agent Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0
In-Reply-To <56DDAE71.1030100@timgolden.me.uk>
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:104232

Show key headers only | View raw


On 07/03/2016 16:38, Tim Golden wrote:
> 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
>

Thanks, you saved me searching for the link that I knew existed :)

-- 
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.

Mark Lawrence

Back to comp.lang.python | Previous | NextPrevious 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