Skip to content

ngettext has different annotations to ngettext_lazy #3454

Description

@delfick

Hello,

I've noticed that the number argument to ngettext is different between the lazy and non lazy versions

def ngettext(singular: str, plural: str, number: float) -> str: ...
def pgettext(context: str, message: str) -> str: ...
def npgettext(context: str, singular: str, plural: str, number: int) -> str: ...
# lazy evaluated translation functions
def gettext_lazy(message: str) -> _StrPromise: ...
def pgettext_lazy(context: str, message: str) -> _StrPromise: ...
def ngettext_lazy(singular: str, plural: str, number: int | str | None = None) -> _StrPromise: ...
def npgettext_lazy(context: str, singular: str, plural: str, number: int | str | None = None) -> _StrPromise: ...

In the non lazy version it's float but in the lazy version it's int | str | None

Should they both be int | str | None?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions