'Returns a string representation for debugging.'

def __repr__(self):

    class_name = self.__class__.__name__
    text = (self.__unicode__().encode('utf-8') if PY2 else str(self))
    ret = '{cls}("{text}")'.format(cls=class_name, text=text)
    return (binary_type(ret) if PY2 else ret)
