
Aha, indeed! Removed callable(). Instead of callable(f) you can use hasattr(f,
'__call__'). The operator.isCallable() function is also gone.
What is the tradeoff between hasattr(f, '__call__') and isinstance(f, Callable)? - Andrey On Fri, Sep 25, 2009 at 10:39 AM, Gerald Britton <gerald.britton@gmail.com>wrote:
I think callable() was removed in 3.x:
http://docs.python.org/3.1/whatsnew/3.0.html?highlight=callable
On Fri, Sep 25, 2009 at 10:34 AM, Andrey Fedorov <anfedorov@gmail.com> wrote:
So there was a discussion back in April [0] about the lack of an "iterable" predicate, which Pascal pointing out that the intention may be to use "isinstance(obj, Iterable)" instead. That seems inconsistent with the existence of collections.Callable (so, isinstance(obj, Callable) instead of callable(obj)).
Which direction is this more likely to be resolved? Should I write iterable(obj) or expect callable(obj) to be deprecated?
- Andrey
0. http://mail.python.org/pipermail/python-ideas/2009-April/004382.html
_______________________________________________ Python-ideas mailing list Python-ideas@python.org http://mail.python.org/mailman/listinfo/python-ideas
-- Gerald Britton