[pypy-svn] r75518 - in pypy/branch/fast-forward/pypy/interpreter/astcompiler: . test
benjamin at codespeak.net
benjamin at codespeak.net
Wed Jun 23 05:31:46 CEST 2010
Author: benjamin
Date: Wed Jun 23 05:31:45 2010
New Revision: 75518
Modified:
pypy/branch/fast-forward/pypy/interpreter/astcompiler/symtable.py
pypy/branch/fast-forward/pypy/interpreter/astcompiler/test/test_symtable.py
Log:
generators must recieve an implicit first argument
Modified: pypy/branch/fast-forward/pypy/interpreter/astcompiler/symtable.py
==============================================================================
--- pypy/branch/fast-forward/pypy/interpreter/astcompiler/symtable.py (original)
+++ pypy/branch/fast-forward/pypy/interpreter/astcompiler/symtable.py Wed Jun 23 05:31:45 2010
@@ -436,6 +436,7 @@
outer.iter.walkabout(self)
new_scope = FunctionScope("genexp", genexp.lineno, genexp.col_offset)
self.push_scope(new_scope, genexp)
+ self.implicit_arg(0)
outer.target.walkabout(self)
if outer.ifs:
self.visit_sequence(outer.ifs)
Modified: pypy/branch/fast-forward/pypy/interpreter/astcompiler/test/test_symtable.py
==============================================================================
--- pypy/branch/fast-forward/pypy/interpreter/astcompiler/test/test_symtable.py (original)
+++ pypy/branch/fast-forward/pypy/interpreter/astcompiler/test/test_symtable.py Wed Jun 23 05:31:45 2010
@@ -81,6 +81,7 @@
self.check_unknown(scp, "y", "x")
self.check_unknown(gscp, "z")
assert gscp.lookup("y") == symtable.SCOPE_LOCAL
+ assert gscp.lookup(".0") == symtable.SCOPE_LOCAL
scp, gscp = self.gen_scope("(x for x in z if x)")
self.check_unknown(scp, "x")
assert gscp.lookup("x") == symtable.SCOPE_LOCAL
More information about the Pypy-commit
mailing list