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/133144.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 expressionsNikolaus Rath Nikolaus at rath.org
Thu Mar 13 16:31:00 CET 2014
Tres Seaver <tseaver at palladion.com> writes:
> 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*.

In my opinion that's almost as ugly, because it still forces you to
specify the attribute name as a string rather than an identifier.


Best,
Nikolaus

-- 
Encrypted emails preferred.
PGP fingerprint: 5B93 61F8 4EA2 E279 ABF6  02CF A9AD B7F8 AE4E 425C

             »Time flies like an arrow, fruit flies like a Banana.«
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