Skip to content

Commit eac27e3

Browse files
committed
Revert update to _ngettext type hint and docstring.
It sometimes gets called with a float (and seems to work as expected), but it looks like it officially only supports an int, so leave it as it was.
1 parent 01b38a7 commit eac27e3

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/humanize/i18n.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,14 +107,14 @@ def _pgettext(msgctxt: str, message: str) -> str:
107107
return message if translation == key else translation
108108

109109

110-
def _ngettext(message: str, plural: str, num: int | float) -> str:
110+
def _ngettext(message: str, plural: str, num: int) -> str:
111111
"""Plural version of _gettext.
112112
113113
Args:
114114
message (str): Singular text to translate.
115115
plural (str): Plural text to translate.
116-
num (int or float): The number (e.g. item count) to determine translation for
117-
the respective grammatical number.
116+
num (int): The number (e.g. item count) to determine translation for the
117+
respective grammatical number.
118118
119119
Returns:
120120
str: Translated text.

0 commit comments

Comments
 (0)