#NEWLINE# def simple_repr( f ) : #NEWLINE# #INDENT# 'Implements a simple class repr.' #NEWLINE# def __repr__( self ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# val = f ( self ) #NEWLINE# if isinstance ( val , unicode ) : #NEWLINE# #INDENT# val = val . encode ( 'utf-8' ) #NEWLINE# #UNINDENT# #UNINDENT# except Exception : #NEWLINE# #INDENT# val = '???' #NEWLINE# #UNINDENT# return ( '<%s %s>' % ( type ( self ) . __name__ , val ) ) #NEWLINE# #UNINDENT# return __repr__