required parentheses (`not (foo in bar)`) which was odd.
- Fixed a bug that caused syntax errors when defining macros or using the
`{% call %}` tag inside loops.
+- Fixed a bug in the parser that made ``{{ foo[1, 2] }}`` impossible.
Version 2.1.1
-------------
if len(args) == 1:
arg = args[0]
else:
- arg = nodes.Tuple(args, self.lineno, self.filename)
+ arg = nodes.Tuple(args, 'load', lineno=token.lineno)
return nodes.Getitem(node, arg, 'load', lineno=token.lineno)
self.fail('expected subscript expression', self.lineno)
bar = xrange(100)
tmpl = env.from_string('''{{ not 42 in bar }}''')
assert tmpl.render(bar=bar) == unicode(not 42 in bar)
+
+
+def test_implicit_subscribed_tuple(env):
+ class Foo(object):
+ def __getitem__(self, x):
+ return x
+ t = env.from_string('{{ foo[1, 2] }}')
+ assert t.render(foo=Foo()) == u'(1, 2)'