def object_description(object):
 try:
  s = repr(object)
 except Exception:
  raise ValueError
 if isinstance(s, binary_type):
  s = force_decode(s, None)
 s = memory_address_re.sub('', s)
 return s.replace('\n', ' ')

def object_description ( object ) : try : s = repr ( object ) except Exception : raise ValueError if isinstance ( s , binary_type ) : s = force_decode ( s , None ) s = memory_address_re . sub ( '' , s ) return s . replace ( '\n' , ' ' )
a repr() implementation that returns text safe to use in rest context .