Callable (object)
英文说明: Check whether object is callable. If return true,object still may fail, but if return false, calling object Ojbect will never succeed.
Note : A class or function can be called directly (because the call method is already defaulted), and the instance in the class must have the __call__ () method to be called.
version : This function is available in the python2.x version. However, it was removed in the python3.0 version and was re-added in the later version of python3.2.
code example:
1>>>Callable (0)2 False3 4>>> Callable ("mystring")5 False6 7>>>defaaa ():8 Pass9>>>Callable (AAA)Ten True One A>>>classA: -...defmethod (self): -...return0 the ... .. ->>>callable (A) - True ->>> A =A () +>>>callable (a) - False + A>>>classB: at...def __call__(self): -...return0 ->>>callable (B) - True ->>> B =B () ->>>callable (b) inTrue
Python function callable