summaryrefslogtreecommitdiffstats
path: root/Tools/compiler
diff options
context:
space:
mode:
authorNeil Schemenauer <nascheme@enme.ucalgary.ca>2005-06-02 05:55:20 (GMT)
committerNeil Schemenauer <nascheme@enme.ucalgary.ca>2005-06-02 05:55:20 (GMT)
commitf36947032f4e99b2c55fc25fa36a1960c4423cbb (patch)
tree68a6122f3415232b331b59a408e469b7d728063a /Tools/compiler
parent76276177dea7d3e1412390e36a2c260f3f8107cb (diff)
downloadcpython-f36947032f4e99b2c55fc25fa36a1960c4423cbb.zip
cpython-f36947032f4e99b2c55fc25fa36a1960c4423cbb.tar.gz
cpython-f36947032f4e99b2c55fc25fa36a1960c4423cbb.tar.bz2
Fix compiler.ast.flatten function so that it works on lists.
Diffstat (limited to 'Tools/compiler')
-rw-r--r--Tools/compiler/astgen.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/Tools/compiler/astgen.py b/Tools/compiler/astgen.py
index 4ccc54d..e6aa350 100644
--- a/Tools/compiler/astgen.py
+++ b/Tools/compiler/astgen.py
@@ -234,9 +234,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):
@@ -245,8 +245,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 = {}