Skip to content
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

Parameter matching for unpacked TypeVar not enforced #9808

Open
erictraut opened this issue Feb 3, 2025 · 0 comments
Open

Parameter matching for unpacked TypeVar not enforced #9808

erictraut opened this issue Feb 3, 2025 · 0 comments
Labels
bug Something isn't working spec compliance

Comments

@erictraut
Copy link
Collaborator

The typing spec indicates that if a caller passes an unpacked (non-closed) TypeVar as an argument to a function that accepts a fixed set of keyword argument, it should result in an error because additional items may be present in the argument TypedDict.

# > Kwargs hinted with an unpacked TypedDict can only be passed to another function if the function
# > to which unpacked kwargs are being passed to has **kwargs in its signature as well,
# > because then additional keywords would not cause errors at runtime during function invocation. 
# > Otherwise, the type checker should generate an error.

For more details, refer to this pull request in the conformance tests.

@erictraut erictraut added bug Something isn't working spec compliance labels Feb 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working spec compliance
Projects
None yet
Development

No branches or pull requests

1 participant