[ty] Support inheriting from functional TypedDict#24227
Merged
charliermarsh merged 1 commit intocharlie/typed-dict-1from Mar 27, 2026
Merged
[ty] Support inheriting from functional TypedDict#24227charliermarsh merged 1 commit intocharlie/typed-dict-1from
charliermarsh merged 1 commit intocharlie/typed-dict-1from
Conversation
Member
Author
|
This is a revival of #24175 which was accidentally merged. |
Typing conformance resultsNo changes detected ✅Current numbersThe percentage of diagnostics emitted that were expected errors held steady at 86.50%. The percentage of expected errors that received a diagnostic held steady at 81.37%. The number of fully passing files held steady at 67/132. |
Memory usage reportMemory usage unchanged ✅ |
|
| Lint rule | Added | Removed | Changed |
|---|---|---|---|
invalid-await |
40 | 0 | 0 |
invalid-key |
0 | 4 | 0 |
invalid-argument-type |
0 | 2 | 0 |
invalid-return-type |
1 | 0 | 0 |
| Total | 41 | 6 | 0 |
Changes in flaky projects detected. Raw diff output excludes flaky projects; see the HTML report for details.
Raw diff:
meson (https://github.com/mesonbuild/meson)
- mesonbuild/cargo/manifest.py:557:54 error[invalid-argument-type] Argument to bound method `from_raw` is incorrect: Expected `BuildTarget`, found `dict[str, str]`
- mesonbuild/cargo/manifest.py:557:73 error[invalid-key] Unknown key "path" for TypedDict `BuildTarget`
- mesonbuild/cargo/manifest.py:563:54 error[invalid-argument-type] Argument to bound method `from_raw` is incorrect: Expected `BuildTarget`, found `dict[str, str]`
- mesonbuild/cargo/manifest.py:563:73 error[invalid-key] Unknown key "path" for TypedDict `BuildTarget`840ccaf to
16d6a83
Compare
1b18838 to
090a0f0
Compare
16d6a83 to
001485c
Compare
090a0f0 to
6f3c8ad
Compare
c98456b to
41e630e
Compare
6f3c8ad to
328bd5c
Compare
AlexWaygood
reviewed
Mar 27, 2026
328bd5c to
50d1ded
Compare
50d1ded to
5ba83c8
Compare
c67996f to
c196f46
Compare
5ba83c8 to
967e0d5
Compare
charliermarsh
added a commit
that referenced
this pull request
Mar 30, 2026
## Summary This PR adds basic support for functional TypedDict construction, including recursive TypedDicts. The intent is to follow the patterns we've established for functional NamedTuple and `type(...)` calls as closely as we can. There are two follow-up PRs that were carved out to make them easier to review: - #24226 - #24227 (My intent is to merge the stack once all three are approved. E.g., the new false positive in the ecosystem test is fixed in #24176.) Part of: astral-sh/ty#3095. --------- Co-authored-by: Alex Waygood <alex.waygood@gmail.com>
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 PR adds handling for class-based TypedDicts that inherit from functional TypedDicts.
Part of: astral-sh/ty#3095.