[pypy-svn] r58255 - pypy/branch/tuple-nonresizable-395/pypy/interpreter/pyparser
arigo at codespeak.net
arigo at codespeak.net
Sat Sep 20 12:37:05 CEST 2008
Author: arigo
Date: Sat Sep 20 12:37:04 2008
New Revision: 58255
Modified:
pypy/branch/tuple-nonresizable-395/pypy/interpreter/pyparser/astbuilder.py
Log:
Kill pointless code. This optimization is done in a more general way
later by opt.py.
Modified: pypy/branch/tuple-nonresizable-395/pypy/interpreter/pyparser/astbuilder.py
==============================================================================
--- pypy/branch/tuple-nonresizable-395/pypy/interpreter/pyparser/astbuilder.py (original)
+++ pypy/branch/tuple-nonresizable-395/pypy/interpreter/pyparser/astbuilder.py Sat Sep 20 12:37:04 2008
@@ -421,6 +421,7 @@
items = []
for i in range(0, l, 2): # this is atoms not 1
items.append(atoms[i])
+ builder.push(ast.Tuple(items, lineno))
else:
# genfor: 'i for i in j'
# GenExpr(GenExprInner(Name('i'), [GenExprFor(AssName('i', 'OP_ASSIGN'), Name('j'), [])])))]))
@@ -428,15 +429,6 @@
genexpr_for = parse_genexpr_for(atoms[1:])
genexpr_for[0].is_outmost = True
builder.push(ast.GenExpr(ast.GenExprInner(expr, genexpr_for, lineno), lineno))
- return
- for item in items:
- if not isinstance(item, ast.Const):
- builder.push(ast.Tuple(items, lineno))
- return
- # isinstance as a hint for annotator
- values = [item.value for item in items if isinstance(item, ast.Const)]
- builder.push(ast.Const(builder.space.newtuple(values), lineno))
- return
def build_lambdef(builder, nb):
"""lambdef: 'lambda' [varargslist] ':' test"""
More information about the Pypy-commit
mailing list