-
-
Notifications
You must be signed in to change notification settings - Fork 458
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
_StrPromise
on a TypedDict
#1804
Comments
This has been brought up previously, or a slightly different version of it. Which you'll probably find if you start off somewhere around here: #689 (comment). Which is some discussion(s) and reasoning from when The short version is something like: while the promise returned by |
Ah, OK. Sorry if I've re-raised a previous discussion - I did do a search first but obviously missed those specific comments. So for this specific case the correct solution (and will remain the correct solution) is to use And if you close this one, at least there's an "obvious" issue that will pop up in a search for it in the event somebody else is looking for the same thing :) |
Yep, from django_stubs_ext import StrOrPromise
class CustomItem(TypedDict):
name: StrOrPromise
value: str |
No worries. As you said, now we hopefully have something that is more searchable. I'm gonna close this off for now. |
Bug report
What's wrong
If I define a
TypedDict
And a dict that uses this:
I get the resulting message:
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 asstr
System information
python
version: 3.11.6django
version: 4.2.6mypy
version: 1.6.1django-stubs
version: 4.2.6django-stubs-ext
version: 4.2.5The text was updated successfully, but these errors were encountered: