other ways to check for <type 'function'>?

bearophileHUGS at lycos.com bearophileHUGS at lycos.com
Thu Nov 2 09:21:10 EST 2006


elderic:
> 1.: --> sort of clumsy and discouraged by the docs as far as I read
> import types
> type(f) is types.FunctionType

What's the problem with this?

from types import FunctionType
if isinstance(f, FunctionType):
    ...

Bye,
bearophile




More information about the Python-list mailing list