def describe_object(o, FunctionType=types.FunctionType, MethodType=types.MethodType, InstanceType=types.InstanceType):
 sl = []
 if isinstance(o, FunctionType):
  try:
   sl.append(("<type 'function' %s>" % str(o.func_name)))
  except:
   pass
 elif isinstance(o, MethodType):
  try:
   sl.append(("<type 'method' %s>" % str(o.im_func.func_name)))
  except:
   pass
 elif isinstance(o, InstanceType):
  try:
   sl.append(("<type 'instance' %s>" % str(o.__class__.__name__)))
  except:
   pass
 else:
  sl.append(str(type(o)))
 try:
  sl.append(str(len(o)))
 except:
  pass
 return ''.join(sl)

def describe_object ( o , FunctionType = types . FunctionType , MethodType = types . MethodType , InstanceType = types . InstanceType ) : sl = [ ] if isinstance ( o , FunctionType ) : try : sl . append ( ( "<type 'function' %s>" % str ( o . func_name ) ) ) except : pass elif isinstance ( o , MethodType ) : try : sl . append ( ( "<type 'method' %s>" % str ( o . im_func . func_name ) ) ) except : pass elif isinstance ( o , InstanceType ) : try : sl . append ( ( "<type 'instance' %s>" % str ( o . __class__ . __name__ ) ) ) except : pass else : sl . append ( str ( type ( o ) ) ) try : sl . append ( str ( len ( o ) ) ) except : pass return '' . join ( sl )
for human analysis .