def p_testlist(p):
 if (len(p) == 2):
  p[0] = p[1]
 elif isinstance(p[1], list):
  p[0] = p[1]
 else:
  p[0] = [p[1]]
 if isinstance(p[0], list):
  p[0] = ast.Tuple(p[0])

def p_testlist ( p ) : if ( len ( p ) == 2 ) : p [ 0 ] = p [ 1 ] elif isinstance ( p [ 1 ] , list ) : p [ 0 ] = p [ 1 ] else : p [ 0 ] = [ p [ 1 ] ] if isinstance ( p [ 0 ] , list ) : p [ 0 ] = ast . Tuple ( p [ 0 ] )
testlist : testlist_multi comma | testlist_multi .