#NEWLINE# def repr_dict( self , x , level ) : #NEWLINE# #INDENT# n = len ( x ) #NEWLINE# if ( n == 0 ) : #NEWLINE# #INDENT# return '{}' #NEWLINE# #UNINDENT# if ( level <= 0 ) : #NEWLINE# #INDENT# return '{...}' #NEWLINE# #UNINDENT# newlevel = ( level - 1 ) #NEWLINE# repr1 = self . repr1 #NEWLINE# pieces = [ ] #NEWLINE# for key in islice ( _possibly_sorted ( x ) , self . maxdict ) : #NEWLINE# #INDENT# keyrepr = repr1 ( key , newlevel ) #NEWLINE# valrepr = repr1 ( x [ key ] , newlevel ) #NEWLINE# pieces . append ( ( '%s: %s' % ( keyrepr , valrepr ) ) ) #NEWLINE# #UNINDENT# if ( n > self . maxdict ) : #NEWLINE# #INDENT# pieces . append ( '...' ) #NEWLINE# #UNINDENT# s = ', ' . join ( pieces ) #NEWLINE# return ( '{%s}' % ( s , ) )