def str_repr(klass):
if PY2:<EOL><INDENT>klass.__unicode__ = klass.__str__<EOL>klass.__str__ = lambda self: self.__unicode__().encode('<STR_LIT:utf-8>')<EOL><DEDENT>klass.__repr__ = lambda self: '<STR_LIT>' % (self.__class__.__name__, str(self))<EOL>return klass<EOL>
Implements string conversion methods for the given class.

The given class must implement the __str__ method. This decorat
will add __repr__ and __unicode__ (for Python 2).