Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

check if variable is function python

# Use types.FunctionType
>>> import types
>>> types.FunctionType
<class 'function'>

>>> def f(): pass

>>> isinstance(f, types.FunctionType)
True
>>> isinstance(lambda x : None, types.FunctionType)
True
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #check #variable #function #python
ADD COMMENT
Topic
Name
5+4 =