-
Notifications
You must be signed in to change notification settings - Fork 765
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
kwargs typings are broken #6732
Comments
Sorry can you provide the information in this bug instead of adding comments to an older bug? Please reopen when you have the information. |
I tried to give typings to my kwargs, following this comment: But - It produced this bug for me: |
Okay thanks. I can reproduce the problem. I believe it's because when inside the inner_dict, it doesn't have a type for inner_dict unless the other keyword is supplied. It can't compute what inner_dict is supposed to be. |
Here's the code I used: from typing import Unpack, TypedDict
class InnerDict(TypedDict):
a: int
b: str
class OuterDict(TypedDict):
inner: InnerDict
field_1: str
def test_inner_dict(**kwargs: Unpack[OuterDict]):
pass
test_inner_dict(inner={}) Completions for the inner only work if |
@rchiodo |
Sorry but I don't know yet. It's not a very high priority item as it's not a regression and you're the first person to find the issue so it's unlikely I'll look into the solution anytime soon. |
With Python 3.10
Following this issue:
#2541 (comment)
I tried to use it, and got 2 bugs:
#2541 (comment)
I also opened a bug for mypy:
python/mypy#18243 (comment)
The text was updated successfully, but these errors were encountered: