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 ezio.melotti
Recipients benjamin.peterson, ezio.melotti, georg.brandl, milko.krachounov, ncoghlan
Date 2009-10-03.06:13:26
SpamBayes Score 9.889145e-12
Marked as misclassified No
Message-id <>
Benjamin already replaced hasattr(x, "__call__") with hasattr(type(x),
"__call__") in the Python 3.0 "What's New" in r75090 and r75094, but
this still doesn't match completely the behavior of callable():

>>> class Foo(object): pass
>>> foo = Foo()
>>> callable(foo)
>>> hasattr(type(foo), '__call__')
>>> foo()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: 'Foo' object is not callable

There are also other places where hasattr(x, "__call__") is still
suggested/used (e.g. PEP3100).
Date User Action Args
2009-10-03 06:13:29ezio.melottisetrecipients: + ezio.melotti, georg.brandl, ncoghlan, benjamin.peterson, milko.krachounov
2009-10-03 06:13:29ezio.melottisetmessageid: <>
2009-10-03 06:13:27ezio.melottilinkissue7006 messages
2009-10-03 06:13:27ezio.melotticreate