views:

70

answers:

2

Hi, I was studying introspection in Python, and as I was getting through basic examples, I found out that the callable built-in function is no longer available in Python 3.1.

How can I check if a method is callable now?

Thank you

+3  A: 
if hasattr(f, "__call__"):

What's New In Python 3.0

cobbal
+1  A: 
isinstance(f, collections.Callable)
SilentGhost