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

Fix subtyping of callables with Unpack #17843

Closed

Conversation

A5rocks
Copy link
Contributor

@A5rocks A5rocks commented Sep 27, 2024

Fixes #16662. This PR fixes def f(*args: Unpack[tuple[object, ...]])'s subtyping. This only comes into play for more convoluted test cases as unfortunately there is some special casing to look through. Hopefully we can remove some.

Split off #17512 to allow for less code to review.

This comment has been minimized.

@A5rocks
Copy link
Contributor Author

A5rocks commented Sep 27, 2024

Nevermind! Turns out that this fix requires the other one!

Not sure why I didn't test first, I guess I just assumed this would work.

@A5rocks A5rocks closed this Sep 27, 2024
@A5rocks A5rocks deleted the unpack-variable-tuple-subtyping branch September 27, 2024 16:11
Copy link
Contributor

According to mypy_primer, this change doesn't affect type check results on a corpus of open source code. ✅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant