diff options
Diffstat (limited to 'src/zope/tales/pythonexpr.py')
-rw-r--r-- | src/zope/tales/pythonexpr.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/zope/tales/pythonexpr.py b/src/zope/tales/pythonexpr.py index ffa5c84..3f47bed 100644 --- a/src/zope/tales/pythonexpr.py +++ b/src/zope/tales/pythonexpr.py @@ -15,7 +15,16 @@ """ class PythonExpr(object): + """ + Evaluates a python expression by calling :func:`eval` after + compiling it with :func:`compile`. + """ def __init__(self, name, expr, engine): + """ + :param str expr: The Python expression. + :param ExpressionEngine engine: The expression compiler that + is creating us. + """ text = '\n'.join(expr.splitlines()) # normalize line endings text = '(' + text + ')' # Put text in parens so newlines don't matter self.text = text |