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 <1254550409.27.0.282122052898.issue7006@psf.upfronthosting.co.za>
In-reply-to
Content
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)
False
>>> hasattr(type(foo), '__call__')
True
>>> 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).
History
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: <1254550409.27.0.282122052898.issue7006@psf.upfronthosting.co.za>
2009-10-03 06:13:27ezio.melottilinkissue7006 messages
2009-10-03 06:13:27ezio.melotticreate