How do I detect whether a variable is a function?

I have a variable, x, and I want to know whether it is pointing to a function or not.

I had hoped I could do something like:

>>> isinstance(x, function)

But that gives me:

Traceback (most recent call last):
  File "", line 1, in ?
NameError: name 'function' is not defined

The reason I picked that is because

>>> type(x)

← Назад к списку