def get_method_attr(method, cls, attr_name, default=False):
 Missing = object()
 value = getattr(method, attr_name, Missing)
 if ((value is Missing) and (cls is not None)):
  value = getattr(cls, attr_name, Missing)
 if (value is Missing):
  return default
 return value

def get_method_attr ( method , cls , attr_name , default = False ) : Missing = object ( ) value = getattr ( method , attr_name , Missing ) if ( ( value is Missing ) and ( cls is not None ) ) : value = getattr ( cls , attr_name , Missing ) if ( value is Missing ) : return default return value
look up an attribute on a method/ function .