[pypy-svn] r66409 - in pypy/branch/parser-compiler/pypy/interpreter/astcompiler: . test
benjamin at codespeak.net
benjamin at codespeak.net
Sun Jul 19 05:39:45 CEST 2009
Author: benjamin
Date: Sun Jul 19 05:39:43 2009
New Revision: 66409
Modified:
pypy/branch/parser-compiler/pypy/interpreter/astcompiler/codegen.py
pypy/branch/parser-compiler/pypy/interpreter/astcompiler/test/test_compiler.py
Log:
implement backquote repr, for which there was not a single test
Modified: pypy/branch/parser-compiler/pypy/interpreter/astcompiler/codegen.py
==============================================================================
--- pypy/branch/parser-compiler/pypy/interpreter/astcompiler/codegen.py (original)
+++ pypy/branch/parser-compiler/pypy/interpreter/astcompiler/codegen.py Sun Jul 19 05:39:43 2009
@@ -996,6 +996,11 @@
self.emit_op(ops.GET_ITER)
self.emit_op_arg(ops.CALL_FUNCTION, 1)
+ def visit_Repr(self, rep):
+ self.update_position(rep.lineno)
+ rep.value.walkabout(self)
+ self.emit_op(ops.UNARY_CONVERT)
+
def visit_Attribute(self, attr):
self.update_position(attr.lineno)
names = self.names
Modified: pypy/branch/parser-compiler/pypy/interpreter/astcompiler/test/test_compiler.py
==============================================================================
--- pypy/branch/parser-compiler/pypy/interpreter/astcompiler/test/test_compiler.py (original)
+++ pypy/branch/parser-compiler/pypy/interpreter/astcompiler/test/test_compiler.py Sun Jul 19 05:39:43 2009
@@ -712,6 +712,9 @@
def test_lambda(self):
yield self.st, "y = lambda x: x", "y(4)", 4
+ def test_backquote_repr(self):
+ yield self.st, "x = None; y = `x`", "y", "None"
+
class AppTestPrint:
More information about the Pypy-commit
mailing list