Type of Python function pointer
I would use types.FunctionType
to represent a function:
>>> import types
>>> types.FunctionType
<class 'function'>
>>>
>>> def func():
... pass
...
>>> type(func)
<class 'function'>
>>> isinstance(func, types.FunctionType)
True
>>>
You could also use a string literal such as 'function'
, but it looks like you want an actual type object.