Message307876
Before testing, let alone documenting, the status quo, I would like to be sure that suppressing the exception is truly the intended behavior. Is there a way to get an annotated listing from git (given which patch, and therefore which person, is responsible for each line)? I will try asking on pydev.
Calling __getattr__ on property failure is a behavior of __getattribute__, not of the property, and I would expect object.__getattribute__ to be tested wherever object is, but I have not found such tests. If we do add a test, the best model in test_desc.py looks like `def test_module_subclasses(self):`. The test class would only need __getattr__ and the faulty property.
class Foo(object):
def __getattr__(self, name):
print(f'Getattr {name}')
return True
@property
def bing(self):
print('Property bing')
raise AttributeError("blarg")
f = Foo()
print(f.bing)
#prints (which would be the log list in a test)
Property bing
Getattr bing
True |
|
Date |
User |
Action |
Args |
2017-12-09 02:27:29 | terry.reedy | set | recipients:
+ terry.reedy, dstanek, eric.araujo, docs@python, Paul.Davis, cheryl.sabella |
2017-12-09 02:27:28 | terry.reedy | set | messageid: <1512786448.95.0.213398074469.issue8722@psf.upfronthosting.co.za> |
2017-12-09 02:27:28 | terry.reedy | link | issue8722 messages |
2017-12-09 02:27:27 | terry.reedy | create | |
|