Mercurial > genshi > mirror
changeset 563:9d1c5c290254 trunk
Built-in Python constants (such as `None`) in expressions are used directly instead of being looked up from the context.
author | cmlenz |
---|---|
date | Fri, 13 Jul 2007 11:10:38 +0000 |
parents | b3dc05d88751 |
children | aeb89e9730df |
files | genshi/template/eval.py |
diffstat | 1 files changed, 2 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/genshi/template/eval.py +++ b/genshi/template/eval.py @@ -390,7 +390,7 @@ BUILTINS = __builtin__.__dict__.copy() BUILTINS.update({'Markup': Markup, 'Undefined': Undefined}) - +CONSTANTS = frozenset(['False', 'True', 'None', 'NotImplemented', 'Ellipsis']) class ASTTransformer(object): """General purpose base class for AST transformations. @@ -654,7 +654,7 @@ """ def __init__(self): - self.locals = [] + self.locals = [CONSTANTS, set()] def visitConst(self, node): if isinstance(node.value, str):