"""
from __future__ import annotations
-from operator import itemgetter
-
from babel.core import Locale, default_locale
# XXX: remove this file, duplication with babel.plural
"""A tuple with plural information."""
__slots__ = ()
- num_plurals = property(itemgetter(0), doc="""
- The number of plurals used by the locale.""")
- plural_expr = property(itemgetter(1), doc="""
- The plural expression used by the locale.""")
- plural_forms = property(lambda x: 'nplurals={}; plural={};'.format(*x), doc="""
- The plural expression used by the catalog or locale.""")
+
+ @property
+ def num_plurals(self) -> int:
+ """The number of plurals used by the locale."""
+ return self[0]
+
+ @property
+ def plural_expr(self) -> str:
+ """The plural expression used by the locale."""
+ return self[1]
+
+ @property
+ def plural_forms(self) -> str:
+ """The plural expression used by the catalog or locale."""
+ return f'nplurals={self[0]}; plural={self[1]};'
def __str__(self) -> str:
return self.plural_forms