You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
The text was updated successfully, but these errors were encountered:
Bug report
The type annotation added in #126 is incorrect.
What's wrong
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 ofdjango.utils.functional.Promise
The text was updated successfully, but these errors were encountered: