
Nov. 24, 2010
12:20 a.m.
On Tue, 23 Nov 2010 15:15:46 -0800 Alexandre Conrad <alexandre.conrad@gmail.com> wrote:
2010/11/23 Antoine Pitrou <solipsis@pitrou.net>:
So, I would advocate bringing back the callable() builtin, which was easy to use, helpful and semantically sane.
What about:
hasattr(obj, '__call__')
It's not the right code. You can take a look at the implementation of Callable.__subclasshook__ here: http://code.python.org/hg/branches/py3k/file/tip/Lib/_abcoll.py#l139 Regards Antoine.