27 Jul
2010
27 Jul
'10
6:04 p.m.
On Tue, Jul 27, 2010 at 5:25 PM, Robert Kern
I've occasionally wished that we could repurpose backticks for expression literals:
expr = `x + y*z` assert isinstance(expr, ast.Expression)
Maybe you could just as well make it a plain string literal and call a function that parses it into a parse tree: expr = parse("x + y*z") assert isinstance(expr, ast.Expression) The advantage of this approach is that you can define a different language too... -- --Guido van Rossum (python.org/~guido)