def urepr(value):
 if isinstance(value, list):
  return (('[' + ', '.join(map(urepr, value))) + ']')
 if isinstance(value, unicode):
  return (('u"' + value.encode('utf-8').replace('"', '\\"').replace('\\', '\\\\')) + '"')
 return repr(value)

def urepr ( value ) : if isinstance ( value , list ) : return ( ( '[' + ', ' . join ( map ( urepr , value ) ) ) + ']' ) if isinstance ( value , unicode ) : return ( ( 'u"' + value . encode ( 'utf-8' ) . replace ( '"' , '\\"' ) . replace ( '\\' , '\\\\' ) ) + '"' ) return repr ( value )
like repr() .