File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 99"""
1010from __future__ import annotations
1111
12- from operator import itemgetter
13-
1412from babel .core import Locale , default_locale
1513
1614# XXX: remove this file, duplication with babel.plural
@@ -209,12 +207,21 @@ class _PluralTuple(tuple):
209207 """A tuple with plural information."""
210208
211209 __slots__ = ()
212- num_plurals = property (itemgetter (0 ), doc = """
213- The number of plurals used by the locale.""" )
214- plural_expr = property (itemgetter (1 ), doc = """
215- The plural expression used by the locale.""" )
216- plural_forms = property (lambda x : 'nplurals={}; plural={};' .format (* x ), doc = """
217- The plural expression used by the catalog or locale.""" )
210+
211+ @property
212+ def num_plurals (self ) -> int :
213+ """The number of plurals used by the locale."""
214+ return self [0 ]
215+
216+ @property
217+ def plural_expr (self ) -> str :
218+ """The plural expression used by the locale."""
219+ return self [1 ]
220+
221+ @property
222+ def plural_forms (self ) -> str :
223+ """The plural expression used by the catalog or locale."""
224+ return f'nplurals={ self [0 ]} ; plural={ self [1 ]} ;'
218225
219226 def __str__ (self ) -> str :
220227 return self .plural_forms
You can’t perform that action at this time.
0 commit comments