This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author ionelmc
Recipients ionelmc
Date 2015-04-17.18:52:48
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
It appears that callable doesn't really care for the descriptor protocol, so it return True even if __call__ is actually an descriptor that raise AttributeError (clearly not callable at all).


Python 3.4.3 (v3.4.3:9b73f1c3e601, Feb 24 2015, 22:44:40) [MSC v.1600 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> callable
<built-in function callable>
>>> class A:
...  @property
...  def __call__(self):
...   raise AttributeError('go away')
>>> a = A()
>>> a
<__main__.A object at 0x000000000365B5C0>
>>> a.__call__
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "<stdin>", line 4, in __call__
AttributeError: go away
>>> callable(a)
>>> # it should be False :(
Date User Action Args
2015-04-17 18:52:48ionelmcsetrecipients: + ionelmc
2015-04-17 18:52:48ionelmcsetmessageid: <>
2015-04-17 18:52:48ionelmclinkissue23990 messages
2015-04-17 18:52:48ionelmccreate