Repository navigation
Visit functional TypedDict keyword arguments correctly - #28584
Merged
ntBre merged 1 commit intoSep 15, 2026
Merged
Conversation
Summary -- This is a follow-up to the review on #28533. We were previously visiting all of the keyword arguments to functional `TypedDict` constructor calls as type definitions, in line with this usage: ```pycon >>> from typing import TypedDict >>> Point2D = TypedDict('Point2D', x=int, y=int, label=str) >>> Point2D.__required_keys__ frozenset({'x', 'y', 'label'}) ``` However, this usage was actually deprecated in 3.11 and fully removed in 3.13, paving the way for the new `closed` keyword added in 3.15. This PR updates our `TypedDict` keyword argument traversal to visit only these legacy arguments and the new `extra_items` argument as types and to visit other arguments as non-types instead. Test Plan -- New mdtests and a couple of updates to existing snapshots
|
ntBre
marked this pull request as ready for review
September 14, 2026 18:36
MichaReiser
approved these changes
Sep 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
This is a follow-up to the review on #28533. We were previously visiting all of the keyword
arguments to functional
TypedDictconstructor calls as type definitions, in line with this usage:However, this usage was actually deprecated in 3.11 and fully removed in 3.13, paving the way for
the new
closedkeyword added in 3.15.This PR updates our
TypedDictkeyword argument traversal to visit only these legacy arguments andthe new
extra_itemsargument as types and to visit other arguments as non-types instead.Test Plan
New mdtests and a couple of updates to existing snapshots