Closed viernullvier closed 9 years ago
I just ran into a general problem: When using literals in a template, negative int values are evaluated to None instead of their actual value.
Example:
from pybars import Compiler compiler = Compiler() def get_type(self, value): return str(type(value)) helpers = {'type': get_type} source = u'{{{type "string"}}} {{{type 1}}} {{{type -1}}}' template = compiler.compile(source) print template({}, helpers=helpers) >>> <type 'str'> <type 'int'> <type 'NoneType'>
Fixed by e359300bf0f01c4529b23a8e936b106b0a5ed6e0
I just ran into a general problem: When using literals in a template, negative int values are evaluated to None instead of their actual value.
Example: