The usual Python duck typing- based approach is from the old phrase "if it goes crazy like a duck and walks like a duck, it's a duck for me."
, , ( ... ), isinstance .
isinstance ... , Python 2.6 : , - , " ", , ( aka ABC) , , - - .
, , , - :
if hasattr(type(obj), '__call__'): ...
2.6, :
import collections
if isinstance(obj, collections.Callable): ...
. , , , collections.MutableSequence, , .
, ( isinstance) , ABC , , " 4" " " ( ++, !): , .
, , , ; ABC , (ABC - , ), " " , , " isinstance, , , ).