-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
TypeVarTuple as type arg for subclasses of generic TypedDict (fixes #16975) #16977
base: master
Are you sure you want to change the base?
Conversation
mypy/semanal_typeddict.py
Outdated
@@ -316,6 +324,7 @@ def analyze_typeddict_classdef_fields( | |||
analyzed = self.api.anal_type( | |||
stmt.type, | |||
allow_required=True, | |||
allow_unpack=True, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Leaving allow_unpack
out here, or setting it to False
, doesn't have an effect on the test suite... Intuitively I would guess that allow_unpack
should be True
here but would love to understand this a little bit better.
mypy/semanal_typeddict.py
Outdated
@@ -520,6 +529,7 @@ def parse_typeddict_fields_with_types( | |||
analyzed = self.api.anal_type( | |||
type, | |||
allow_required=True, | |||
allow_unpack=True, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And the same applies here.
This comment has been minimized.
This comment has been minimized.
Not wanting to appear impatient, and I appreciate that the reviewers are quite busy -- but is there anything I can do to nudge this along? Perhaps my first sentence didn't inspire confidence:
For what it's worth, though, I took another long look and am now thinking this is in fact the right approach. If it helps makes things more palatable and you're unsure about the two |
I had to rebase to resolve a merge conflict and, while I was at it, I changed the two allow_unpack kwargs into TODO comments. Hope this helps! |
According to mypy_primer, this change doesn't affect type check results on a corpus of open source code. ✅ |
(fixes #16975)
I'm not entirely sure about this implementation -- it fixes the issue and doesn't seem to break anything else -- but it feels like I might be doing things in the wrong phase? If so, a little nudge in the right direction would be much appreciated.