lazy_number
Creates a lazy proxy object that delays the evaluation of a numeric-dependent string until it is formatted or interpolated, allowing for dynamic pluralization based on provided arguments.
def lazy_number(
func: callable,
resultclass: type,
number: int | str | None = null,
**kwargs: dict
) - > lazy object
Creates a lazy translation object that delays evaluation until a numeric value is provided for pluralization. This is used to handle strings that depend on a count that is not known at the time of definition.
Parameters
| Name | Type | Description |
|---|---|---|
| func | callable | The translation function to be called lazily, typically a gettext variant. |
| resultclass | type | The class type that the lazy object should mimic, usually a string type. |
| number | `int | str |
| **kwargs | dict | Additional keyword arguments passed to the translation function. |
Returns
| Type | Description |
|---|---|
lazy object | A lazy proxy object that evaluates to a translated string once a numeric value is supplied via formatting or mapping. |