From f36947032f4e99b2c55fc25fa36a1960c4423cbb Mon Sep 17 00:00:00 2001 From: Neil Schemenauer Date: Thu, 2 Jun 2005 05:55:20 +0000 Subject: Fix compiler.ast.flatten function so that it works on lists. --- Lib/compiler/ast.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'Lib/compiler/ast.py') diff --git a/Lib/compiler/ast.py b/Lib/compiler/ast.py index 6b78fddcd4..accda459e5 100644 --- a/Lib/compiler/ast.py +++ b/Lib/compiler/ast.py @@ -4,9 +4,9 @@ This file is automatically generated by Tools/compiler/astgen.py """ from consts import CO_VARARGS, CO_VARKEYWORDS -def flatten(list): +def flatten(seq): l = [] - for elt in list: + for elt in seq: t = type(elt) if t is tuple or t is list: for elt2 in flatten(elt): @@ -15,8 +15,8 @@ def flatten(list): l.append(elt) return l -def flatten_nodes(list): - return [n for n in flatten(list) if isinstance(n, Node)] +def flatten_nodes(seq): + return [n for n in flatten(seq) if isinstance(n, Node)] nodes = {} -- cgit v1.2.1