[ty] Infer the extra_items keyword argument to class-based TypedDicts as an annotation expression#24362
Conversation
Typing conformance results improved 🎉The percentage of diagnostics emitted that were expected errors increased from 86.76% to 86.79%. The percentage of expected errors that received a diagnostic increased from 81.53% to 81.72%. The number of fully passing files held steady at 70/132. SummaryHow are test cases classified?Each test case represents one expected error annotation or a group of annotations sharing a tag. Counts are per test case, not per diagnostic — multiple diagnostics on the same line count as one. Required annotations (
Test file breakdown1 file altered
True positives added (2)2 diagnostics
|
Memory usage reportMemory usage unchanged ✅ |
|
| Lint rule | Added | Removed | Changed |
|---|---|---|---|
invalid-await |
40 | 0 | 0 |
invalid-return-type |
1 | 0 | 0 |
| Total | 41 | 0 | 0 |
Changes in flaky projects detected. Raw diff output excludes flaky projects; see the HTML report for details.
f3fc283 to
c8adbca
Compare
…ts as an annotation expression
814e002 to
a463cc7
Compare
* main: Document adding fixes in CONTRIBUTING.md (#24393) Sort formatter diagnostics in snapshots (#24375) [`pyupgrade`] Fix panic caused by handling of octals in `UP012` (#24390) Upgrade to nix v0.31.2 (#24385) Strip form feeds from indent passed to `dedent_to` (#24381) add recent move of the `deferred` submodule to `.git-blame-ignore-revs` (#24379) [ty] Fix extra_items TypedDict tests (#24367) [ty] Use `infer_type_expression` for validating PEP-613 type aliases (#24370) [`flake8-simplify`] Make the fix for `collapsible-if` (`SIM102`) safe in `preview` (#24371) [ty] Validate TypedDict fields when subclassing (#24338) [ty] pass type context to sequence literals in binary operations (#24197) Add release environment to notify-dependents job (#24372) Bump 0.15.9 (#24369) [ty] Move the `deferred` submodule inside `infer/builder` (#24368) [ty] Infer the `extra_items` keyword argument to class-based TypedDicts as an annotation expression (#24362) [ty] Validate type qualifiers in functional TypedDict fields and the `extra_items` keyword to functional TypedDicts (#24360)
Summary
Reject illegal TypedDict classes such as
class TD(TypedDict, extra_items=42), and validate qualifiers passed toextra_items.Test Plan
mdtests updated and extended