#NEWLINE# def split_repr( self ) : #NEWLINE# #INDENT# '\n    Return a helpful description of the object using\n    self._repr_words() and self._repr_attrs() to add\n    to the description.  This function may be used by\n    adding code to your class like this:\n\n    >>> class Foo(object):\n    ...     __repr__ = split_repr\n    ...     def _repr_words(self):\n    ...         return ["words", "here"]\n    ...     def _repr_attrs(self):\n    ...         return {\'attrs\': "appear too"}\n    >>> Foo()\n    <Foo words here attrs=\'appear too\'>\n    >>> class Bar(Foo):\n    ...     def _repr_words(self):\n    ...         return Foo._repr_words(self) + ["too"]\n    ...     def _repr_attrs(self):\n    ...         return dict(Foo._repr_attrs(self), barttr=42)\n    >>> Bar()\n    <Bar words here too attrs=\'appear too\' barttr=42>\n    ' #NEWLINE# alist = [ ( str ( k ) , normalize_repr ( v ) ) for ( k , v ) in self . _repr_attrs ( ) . items ( ) ] #NEWLINE# alist . sort ( ) #NEWLINE# words = self . _repr_words ( ) #NEWLINE# if ( ( not words ) and ( not alist ) ) : #NEWLINE# #INDENT# return super ( self . __class__ , self ) . __repr__ ( ) #NEWLINE# #UNINDENT# if ( words and alist ) : #NEWLINE# #INDENT# words . append ( '' ) #NEWLINE# #UNINDENT# return ( '<%s %s>' % ( self . __class__ . __name__ , ( ' ' . join ( words ) + ' ' . join ( [ ( '%s=%s' % itm ) for itm in alist ] ) ) ) )