Mega Code Archive

 
Categories / Python Tutorial / Buildin Function
 

Callable() tells if an object can be invoked via the function operator ()

# It returns True  if the object is callable and False otherwise print callable(dir)              # built-in function print callable(1)                # integer def foo(): pass print callable(foo)              # user-defined function print callable('bar')            # string class C(object): pass print callable(C)                # class