![](https://secure.gravatar.com/avatar/5e43f6b20427550d4a9c90deb006e785.jpg?s=120&d=mm&r=g)
Python 2.4 (#1, Feb 22 2005, 20:15:07) [GCC 3.3.5 (Gentoo Linux 3.3.5-r1, ssp-3.3.2-3, pie-8.7.7.1)] on linux2 Type "help", "copyright", "credits" or "license" for more information.
class A(object): ... def get_x(self): ... there_is_a_bug_here ... x = property(get_x, None, None, '') ... a = A() getattr(a, 'x') Traceback (most recent call last): File "<stdin>", line 1, in ? File "<stdin>", line 3, in get_x NameError: global name 'there_is_a_bug_here' is not defined hasattr(a, 'x') False
Today I have spent a while to hunt down a couple of bugs in my application, because "hasattr" was catching the exceptions. I see there was a patch (#504714, three years ago) that addressed this, but it was rejected because much code would get broken. But, is it going to be considered for sometime in the future? 3.0 maybe? And, would it really break so much code? Wouldn't it instead bring to the day light many bugs that are already there (but failing in a more silent way)? Thanks, -- J. David Ibáñez Itaapy <http://www.itaapy.com> Tel +33 (0)1 42 23 67 45 9 rue Darwin, 75018 Paris Fax +33 (0)1 53 28 27 88