Skip to content
Myr

Also restore original str method

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Armin Ronacher · committed by Armin Ronacher · parent 7854851 · Browse files · 2 files+5 added−1 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+5 added−1 removed

  • tests:+1 added−0 removed
  • other:+4 added−1 removed

2 files+5 added−1 removed

modified:jinja2/filters.py+4 added-1 removed
16 unmodified lines
17from jinja2.utils import Markup, escape, pformat, urlize, soft_unicode, \18 unicode_urlencode, htmlsafe_json_dumps19from jinja2.runtime import Undefined20from jinja2.exceptions import FilterArgumentError21from jinja2._compat import imap, string_types, text_type, iteritems21from jinja2._compat import imap, string_types, text_type, iteritems, PY2222324_word_re = re.compile(r'\w+', re.UNICODE)25_word_beginning_split_re = re.compile(r'([-\s\(\{\[\<]+)', re.UNICODE)
668 unmodified lines
694# people start to print this out in comments or something similar for695# debugging.696_GroupTuple = namedtuple('_GroupTuple', ['grouper', 'list'])697_GroupTuple.__repr__ = tuple.__repr__698_GroupTuple.__str__ = tuple.__str__699if not PY2:700 _GroupTuple.__unicode__ = tuple.__unicode__701702@environmentfilter703def do_groupby(environment, value, attribute):704 """Group a sequence of objects by a common attribute.
371 unmodified lines
modified:tests/test_regression.py+1 added
502 unmodified lines
503 t = _GroupTuple('foo', [1, 2])504 assert t.grouper == 'foo'505 assert t.list == [1, 2]506 assert repr(t) == "('foo', [1, 2])"507 assert str(t) == "('foo', [1, 2])"