def merge_list(old, new):
 if (not old):
  return new
 if isinstance(new, list):
  old.extend(new)
  return old
 else:
  return ','.join([old, new])

def merge_list ( old , new ) : if ( not old ) : return new if isinstance ( new , list ) : old . extend ( new ) return old else : return ',' . join ( [ old , new ] )
merges lists and comma delimited lists .