From fe3b95c61107ce4bf66fc2377ecd7ecc53194216 Mon Sep 17 00:00:00 2001 From: Kevin Marsh Date: Wed, 26 Feb 2020 23:10:53 -0800 Subject: [PATCH] Fix input types of humanize functions (#335) --- .../contrib/humanize/templatetags/humanize.pyi | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/django-stubs/contrib/humanize/templatetags/humanize.pyi b/django-stubs/contrib/humanize/templatetags/humanize.pyi index 86e7459..46bf6fc 100644 --- a/django-stubs/contrib/humanize/templatetags/humanize.pyi +++ b/django-stubs/contrib/humanize/templatetags/humanize.pyi @@ -1,15 +1,14 @@ from datetime import date, datetime as datetime -from decimal import Decimal -from typing import Any, Optional, Union +from typing import Any, Optional, SupportsInt, Union register: Any -def ordinal(value: Optional[str]) -> Optional[str]: ... -def intcomma(value: Optional[Union[Decimal, float, str]], use_l10n: bool = ...) -> str: ... +def ordinal(value: Optional[Union[str, SupportsInt]]) -> Optional[str]: ... +def intcomma(value: Optional[Union[str, SupportsInt]], use_l10n: bool = ...) -> str: ... intword_converters: Any -def intword(value: Optional[str]) -> Optional[Union[int, str]]: ... -def apnumber(value: Optional[str]) -> Optional[Union[int, str]]: ... +def intword(value: Optional[Union[str, SupportsInt]]) -> Optional[Union[int, str]]: ... +def apnumber(value: Optional[Union[str, SupportsInt]]) -> Optional[Union[int, str]]: ... def naturalday(value: Optional[Union[date, str]], arg: None = ...) -> Optional[str]: ... def naturaltime(value: datetime) -> str: ...