def unicode_repr(obj):
 if PY3:
  return repr(obj)
 if hasattr(obj, 'unicode_repr'):
  return obj.unicode_repr()
 if isinstance(obj, unicode):
  return repr(obj)[1:]
 return repr(obj)

def unicode_repr ( obj ) : if PY3 : return repr ( obj ) if hasattr ( obj , 'unicode_repr' ) : return obj . unicode_repr ( ) if isinstance ( obj , unicode ) : return repr ( obj ) [ 1 : ] return repr ( obj )
for classes that was fixed with @python_2_unicode_compatible unicode_repr returns obj .