Jinja2 Changelog
================
+Version 2.9.5
+-------------
+(bugfix release, no release date yet)
+
+- Restored the original repr of the internal `_GroupTuple` because this
+ caused issues with ansible and it was an unintended change. (#654)
+
Version 2.9.4
-------------
(bugfix release, released on January 10th 2017)
return func(value * (10 ** precision)) / (10 ** precision)
+# Use a regular tuple repr here. This is what we did in the past and we
+# really want to hide this custom type as much as possible. In particular
+# we do not want to accidentally expose an auto generated repr in case
+# people start to print this out in comments or something similar for
+# debugging.
_GroupTuple = namedtuple('_GroupTuple', ['grouper', 'list'])
+_GroupTuple.__repr__ = tuple.__repr__
@environmentfilter
def do_groupby(environment, value, attribute):
'main': '{% for item in [1, 2, 3] %}{% include "inc" %}{% endfor %}',
}))
assert env.get_template('main').render() == '123'
+
+ def test_grouper_repr(self):
+ from jinja2.filters import _GroupTuple
+ t = _GroupTuple('foo', [1, 2])
+ assert t.grouper == 'foo'
+ assert t.list == [1, 2]
+ assert repr(t) == "('foo', [1, 2])"