Joe Jevnik added the comment:

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

----------

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

Reply via email to