[Python-checkins] python/dist/src/Lib/compiler ast.py,1.27,1.28

nascheme@users.sourceforge.net nascheme at users.sourceforge.net
Thu Jun 2 07:55:21 CEST 2005


Update of /cvsroot/python/python/dist/src/Lib/compiler
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv367/Lib/compiler
Modified Files:
	ast.py 
Log Message:
Fix compiler.ast.flatten function so that it works on lists.
Index: ast.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/compiler/ast.py,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -d -r1.27 -r1.28
--- ast.py	12 Sep 2004 03:49:29 -0000	1.27
+++ ast.py	2 Jun 2005 05:55:18 -0000	1.28
@@ -4,9 +4,9 @@
 """
 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 @@
 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 = {}
 


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /