Original address: http://www.cnblogs.com/elvisxu/archive/2010/10/26/1861958.html
When I recently learned Python, I ran "Dive into Python" as an example in Python3, and found the error in calling the callable () function times:
Nameerror:name ' callable ' is not defined
Online check found that Python3 has removed this built-in function. Check out Python v3.0 documentation discovery can be used
The Hasattr (object, name) built-in function accomplishes the callable function in the following way:
3.0 Before: Callable (func)
After 3.0: Hasattr (func, ' __call__ ')
The two results are the same.
Note: With the callable () function, we can tell if an object is a callable object.
Callable () Specific meanings can be found in: http://www.liaoxuefeng.com/wiki/001374738125095c955c1e6d8bb493182103fac9270762a000/ 0013946328809098c1be08a2c7e4319bd60269f62be04fa000
"Go" python3.x remove callable built-in functions