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/2010-August/103244.html below:

[Python-Dev] 'hasattr' is broken by design

[Python-Dev] 'hasattr' is broken by design [Python-Dev] 'hasattr' is broken by designP.J. Eby pje at telecommunity.com
Tue Aug 24 16:22:06 CEST 2010
At 03:37 PM 8/24/2010 +0200, Hrvoje Niksic wrote:
>a) a "business" case of throwing anything other than AttributeError 
>from __getattr__ and friends is almost certainly a bug waiting to happen, and

FYI, best practice for __getattr__ is generally to bail with an 
AttributeError as soon as you see double underscores in the name, 
unless you intend to support special attributes.

I don't think this is documented anywhere, but experience got this 
pretty ingrained in my head since Python 2.2 or even earlier.

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