A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2014-March/133128.html below:

[Python-Dev] Requesting pronouncement on PEP 463: Exception-catching expressions

[Python-Dev] Requesting pronouncement on PEP 463: Exception-catching expressions [Python-Dev] Requesting pronouncement on PEP 463: Exception-catching expressionsChris Angelico rosuav at gmail.com
Wed Mar 12 22:49:07 CET 2014
On Thu, Mar 13, 2014 at 8:37 AM, Tres Seaver <tseaver at palladion.com> wrote:
> On 03/12/2014 04:49 PM, Chris Angelico wrote:
>> You can use hasattr() in place of AttributeError
>
> I use:
>
>  getattr(subject, attrname, default)?
>
> *all the time*.

Umm, yeah, that one. Why did I think hasattr was the only way around
that? Anyway, that just means I picked a bad example. There are others
where you have to go for the full try/except.

ChrisA
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4