[Python-ideas] Bring back callable()
solipsis at pitrou.net
Wed Nov 24 00:20:24 CET 2010
On Tue, 23 Nov 2010 15:15:46 -0800
<alexandre.conrad at gmail.com> wrote:
> 2010/11/23 Antoine Pitrou <solipsis at 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__
More information about the Python-ideas