-
-
Notifications
You must be signed in to change notification settings - Fork 521
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Bug report
What's wrong
If I define a TypedDict
class CustomItem(TypedDict):
name: str
value: str
And a dict that uses this:
from django.utils.translation import gettext_lazy as _
MYDICT: dict[str, CustomItem] = {
"test": {"name": _("testing"), "value": "this"}
}
I get the resulting message:
Incompatible types (expression has type "_StrPromise", TypedDict item "name" has type "str")
I am currently using the django_stubs_ext.StrOrPromise instead here, but the README asks us to report if we come across a _StrPromise issue while using Django.
How is that should be
I should be able to type a gettext_lazy value as str
System information
- OS: WSL2 on Win11
pythonversion: 3.11.6djangoversion: 4.2.6mypyversion: 1.6.1django-stubsversion: 4.2.6django-stubs-extversion: 4.2.5
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working