def _seq_pprinter_factory(start, end, basetype):
 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(((start + '...') + end))
  step = len(start)
  p.begin_group(step, start)
  for (idx, x) in p._enumerate(obj):
   if idx:
    p.text(',')
    p.breakable()
   p.pretty(x)
  if ((len(obj) == 1) and (type(obj) is tuple)):
   p.text(',')
  p.end_group(step, end)
 return inner

def _seq_pprinter_factory ( start , end , basetype ) : 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 ( ( ( start + '...' ) + end ) ) step = len ( start ) p . begin_group ( step , start ) for ( idx , x ) in p . _enumerate ( obj ) : if idx : p . text ( ',' ) p . breakable ( ) p . pretty ( x ) if ( ( len ( obj ) == 1 ) and ( type ( obj ) is tuple ) ) : p . text ( ',' ) p . end_group ( step , end ) return inner
factory that returns a pprint function useful for sequences .