def p_atom3(self, p): """atom : LPAR testlist_comp RPAR""" info = p[2] if isinstance(info, CommaSeparatedList): node = myast.Tuple(info.values, lineno=p.lineno(2)) else: node = info p[0] = node
def p_fplist4(self, p): """fplist : fpdef fplist_list COMMA""" p[0] = myast.Tuple([p[1]] + p[2], lineno=p.lineno(2))
def p_fplist2(self, p): """fplist : fpdef COMMA""" p[0] = myast.Tuple([p[1]], lineno=p.lineno(1))
def p_atom1(self, p): """atom : LPAR RPAR""" p[0] = myast.Tuple()
def _ast_for_testlist(self, testlist): if isinstance(testlist, list): value = myast.Tuple() else: value = testlist return value