This is a different case from raising an AttributeError inside the __call__;
>>> class C(object):
... def __call__(self):
... raise AttributeError()
...
>>> hasattr(C(), '__call__')
True
>>> class D(object):
... @property
... def __call__(self):
... raise AttributeError()
...
>>> hasattr(C(), '__call__')
False
AttributeError was picked very intentionally for the example.
The docs show that n(args) == n.__call__(args) if n has a __call__; however, if a property raises an AttributeError, then it really does not have a __call__. |