How to check if a variable is a function in Python?
If this is for Python 2.x or for Python 3.2+, you can use callable(). It used to be deprecated, but is now undeprecated, so you can use it again. You can read the discussion here: http://bugs.python.org/issue10518. You can do this with: callable(obj) If this is for Python 3.x but before 3.2, check if the object … Read more