def _instance_callable(obj):
 if (not isinstance(obj, ClassTypes)):
  return (getattr(obj, '__call__', None) is not None)
 klass = obj
 if (klass.__dict__.get('__call__') is not None):
  return True
 for base in klass.__bases__:
  if _instance_callable(base):
   return True
 return False

def _instance_callable ( obj ) : if ( not isinstance ( obj , ClassTypes ) ) : return ( getattr ( obj , '__call__' , None ) is not None ) klass = obj if ( klass . __dict__ . get ( '__call__' ) is not None ) : return True for base in klass . __bases__ : if _instance_callable ( base ) : return True return False
given an object .