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/103189.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
Mon Aug 23 22:00:06 CEST 2010
At 12:47 PM 8/23/2010 -0700, Raymond Hettinger wrote:
>As your example shows, property() defeats this intent by actually executing
>the code.   A better behavior would not run the code at all.  It would check
>the dictionaries along the MRO but not execute any descriptors associated
>with a given key.

That just introduces a new class of error when the descriptor can 
raise AttributeError (e.g. __slots__ descriptors).  And of course, it 
ignoress __getattr__ and __getattribute__.

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