Skip to content

The function format_lazy should return _StrPromise #2840

@sshishov

Description

@sshishov

Bug report

The function format_lazy should return _StrPromise and not _StrOrPromise.

It is important when the output of this command is used with the function which expect promise only (for lazy evaluation of translation). This is done to notify the user if his translation will be evaluated incorrectly.

What's wrong

We are receiving these type of errors:

error: Argument "my_argument" to "my_function" of "MyClass" has incompatible type "str | _StrPromise"; expected "_StrPromise"  [arg-type]

How is that should be

No typing error should be returned as the format_lazy returning promise by itself

System information

Not Applicable

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions