def _dict_pprinter_factory(start, end, basetype=None):
 def inner(obj, p, cycle):
  typ = type(obj)
  if ((basetype is not None) and (typ is not basetype) and (typ.__repr__ != basetype.__repr__)):
   return p.text(typ.__repr__(obj))
  if cycle:
   return p.text('{...}')
  p.begin_group(1, start)
  keys = obj.keys()
  if (not (p.max_seq_length and (len(obj) >= p.max_seq_length))):
   try:
    keys = sorted(keys)
   except Exception:
    pass
  for (idx, key) in p._enumerate(keys):
   if idx:
    p.text(',')
    p.breakable()
   p.pretty(key)
   p.text(': ')
   p.pretty(obj[key])
  p.end_group(1, end)
 return inner

def _dict_pprinter_factory ( start , end , basetype = None ) : def inner ( obj , p , cycle ) : typ = type ( obj ) if ( ( basetype is not None ) and ( typ is not basetype ) and ( typ . __repr__ != basetype . __repr__ ) ) : return p . text ( typ . __repr__ ( obj ) ) if cycle : return p . text ( '{...}' ) p . begin_group ( 1 , start ) keys = obj . keys ( ) if ( not ( p . max_seq_length and ( len ( obj ) >= p . max_seq_length ) ) ) : try : keys = sorted ( keys ) except Exception : pass for ( idx , key ) in p . _enumerate ( keys ) : if idx : p . text ( ',' ) p . breakable ( ) p . pretty ( key ) p . text ( ': ' ) p . pretty ( obj [ key ] ) p . end_group ( 1 , end ) return inner
factory that returns a pprint function used by the default pprint of dicts and dict proxies .