Terry J. Reedy <tjre...@udel.edu> added the comment:

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

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue8722>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to