Is there a nice way to check whether object o is a builtin Python function?
I know I can use, for example
type(o) == type(pow)
beca
Try this:
>>> import types >>> isinstance(pow, types.BuiltinFunctionType) True >>> def a(): pass >>> isinstance(a, types.BuiltinFunctionType) False