Skip to content

Commit a0c53c1

Browse files
committed
finish support, plural update
1 parent 941f009 commit a0c53c1

2 files changed

Lines changed: 83 additions & 61 deletions

File tree

babel/plural.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,14 @@
1414
from collections.abc import Iterable, Mapping
1515
from typing import Any
1616

17+
if TYPE_CHECKING:
18+
from typing_extensions import Literal
19+
1720
_plural_tags = ('zero', 'one', 'two', 'few', 'many', 'other')
1821
_fallback_tag = 'other'
1922

2023

21-
def extract_operands(source: float | decimal.Decimal) -> tuple[decimal.Decimal, int, int, int, int, int, int, int]:
24+
def extract_operands(source: float | decimal.Decimal) -> tuple[decimal.Decimal | int, int, int, int, int, int, Literal[0], Literal[0]]:
2225
"""Extract operands from a decimal, a float or an int, according to `CLDR rules`_.
2326
2427
The result is a 8-tuple (n, i, v, w, f, t, c, e), where those symbols are as follows:

0 commit comments

Comments
 (0)