Make some minor fixes and improvements to the typedddicts_extra_items test #2073
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I'm in the process of implementing PEP 728 in Pyrefly and noticed a few things that could be improved in the corresponding conformance test.
closed=False
when inheriting from a TypedDict withclosed=True
orextra_items
were also adding an illegal extra item in the subclass. Pyright was correctly flagging the extra item but incorrectly not flaggingclosed=False
, meaning it missed the expected error but generated an unexpected one on the same line. I changed the subclass bodies topass
so that the automated conformance checker can detect the missing errors.class
line or thekey: type
line. I found two that were marked as expected on only theclass
line, so I changed them to be allowed on either line.closed=True
being forbidden when subclassing a TypedDict with non-read-only extra items, so I added it. Pyright already passes it.zuban
not being installed, so I addedzuban
to requirements.txt.