Skip to content

[ty] Support inheriting from functional TypedDict#24175

Merged
charliermarsh merged 1 commit intocharlie/typed-dict-1from
charlie/typed-dict-2
Mar 27, 2026
Merged

[ty] Support inheriting from functional TypedDict#24175
charliermarsh merged 1 commit intocharlie/typed-dict-1from
charlie/typed-dict-2

Conversation

@charliermarsh
Copy link
Copy Markdown
Member

@charliermarsh charliermarsh commented Mar 25, 2026

Summary

This PR adds handling for class-based TypedDicts that inherit from functional TypedDicts.

Part of: astral-sh/ty#3095.

@astral-sh-bot astral-sh-bot bot added the ty Multi-file analysis & type inference label Mar 25, 2026
@astral-sh-bot
Copy link
Copy Markdown

astral-sh-bot bot commented Mar 25, 2026

Typing conformance results

No changes detected ✅

Current numbers
The 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.

@astral-sh-bot
Copy link
Copy Markdown

astral-sh-bot bot commented Mar 25, 2026

Memory usage report

Memory usage unchanged ✅

@astral-sh-bot
Copy link
Copy Markdown

astral-sh-bot bot commented Mar 25, 2026

ecosystem-analyzer results

Lint rule Added Removed Changed
invalid-key 0 4 0
invalid-argument-type 0 2 0
Total 0 6 0

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`

prefect (https://github.com/PrefectHQ/prefect)
- src/prefect/cli/version.py:45:48 error[invalid-key] Unknown key "full-revisionid" for TypedDict `VersionInfo`
- src/prefect/utilities/dockerutils.py:69:46 error[invalid-key] Unknown key "full-revisionid" for TypedDict `VersionInfo`

Full report with detailed diff (timing results)

@charliermarsh charliermarsh marked this pull request as ready for review March 25, 2026 16:28
@carljm carljm assigned AlexWaygood and unassigned carljm Mar 25, 2026
@carljm carljm removed their request for review March 25, 2026 18:20
@charliermarsh charliermarsh force-pushed the charlie/typed-dict-2 branch 2 times, most recently from 1edfdbc to e80e895 Compare March 26, 2026 01:03
@codspeed-hq
Copy link
Copy Markdown

codspeed-hq bot commented Mar 26, 2026

Merging this PR will degrade performance by 19.97%

❌ 1 regressed benchmark
✅ 27 untouched benchmarks
⏩ 30 skipped benchmarks1

⚠️ Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Mode Benchmark BASE HEAD Efficiency
WallTime colour_science 60.2 s 75.2 s -19.97%

Comparing charlie/typed-dict-2 (8c2a9cf) with charlie/typed-dict-1 (3465d7f)2

Open in CodSpeed

Footnotes

  1. 30 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

  2. No successful run was found on charlie/typed-dict-1 (3465d7f) during the generation of this report, so 6047fd9 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

@charliermarsh charliermarsh force-pushed the charlie/typed-dict-2 branch 2 times, most recently from f005931 to 39e2479 Compare March 26, 2026 21:58
@charliermarsh charliermarsh force-pushed the charlie/typed-dict-1 branch 2 times, most recently from f1c8f9d to 7a59f8f Compare March 26, 2026 22:13
@charliermarsh charliermarsh force-pushed the charlie/typed-dict-2 branch 3 times, most recently from 86a9862 to 6369ebb Compare March 26, 2026 22:20
@charliermarsh charliermarsh merged commit 8c2a9cf into charlie/typed-dict-1 Mar 27, 2026
48 of 49 checks passed
@charliermarsh charliermarsh deleted the charlie/typed-dict-2 branch March 27, 2026 00:49
@charliermarsh
Copy link
Copy Markdown
Member Author

(Sorry, this accidentally got merged because I pushed a downstream local change to the upstream branch. I will re-open.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ty Multi-file analysis & type inference

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants