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
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