# Use types.FunctionType
>>> import types
>>> types.FunctionType
<class 'function'>
>>> def f(): pass
>>> isinstance(f, types.FunctionType)
True
>>> isinstance(lambda x : None, types.FunctionType)
True
try: x
except NameError: some_fallback_operation( )
else: some_operation(x)