callable() tells if an object can be invoked via the function operator (). : Callable : Buildin Function PYTHON TUTORIALS


PYTHON TUTORIALS » Buildin Function » Callable »

 

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



Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .


PYTHON TUTORIALS

 Navioo Buildin Function
» Callable