-
-
Notifications
You must be signed in to change notification settings - Fork 507
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Bug report
The type annotation added in #126 is incorrect.
What's wrong
from django.utils.translation import gettext_lazy, ngettext_lazy, pgettext_lazy, ugettext_lazy
from django.utils.functional import Promise
a = gettext_lazy("Help")
b = ugettext_lazy("Help")
c = pgettext_lazy("Help")
d = ngettext_lazy("help", "helps")
e = ugettext_lazy("Help")
assert isinstance(a, Promise)
assert isinstance(b, Promise)
assert isinstance(c, Promise)
assert isinstance(d, Promise)
assert isinstance(e, Promise)
How is that should be
For all lazy functions above, django-stubs consider the return type to be str
, which is actually incorrect. All of them are in fact instances of django.utils.functional.Promise
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working