From: Armin Ronacher Date: Tue, 15 Jul 2008 10:22:33 +0000 (+0000) Subject: alternative repr for plural rules X-Git-Tag: 1.0~292 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=29c68975042f86a2fcd0cabb8e39f894d7d789df;p=thirdparty%2Fbabel.git alternative repr for plural rules --- diff --git a/babel/plural.py b/babel/plural.py index a339756d..df3072c2 100644 --- a/babel/plural.py +++ b/babel/plural.py @@ -65,7 +65,12 @@ class PluralRule(object): self.abstract.append((key, _Parser(expr).ast)) def __repr__(self): - return '<%s %r>' % (type(self).__name__, self.abstract) + rules = self.rules + return '<%s %r>' % ( + type(self).__name__, + ', '.join(['%s: %s' % (tag, rules[tag]) for tag in _plural_tags + if tag in rules]) + ) def parse(cls, rules): """Create a `PluralRule` instance for the given rules. If the rules