[ty] Support ** unpacking of TypedDict in dict-literal assignments#24703
Merged
charliermarsh merged 1 commit intomainfrom Apr 22, 2026
Merged
[ty] Support ** unpacking of TypedDict in dict-literal assignments#24703charliermarsh merged 1 commit intomainfrom
** unpacking of TypedDict in dict-literal assignments#24703charliermarsh merged 1 commit intomainfrom
Conversation
** unpacking of TypedDict in dict-literal assignments
Typing conformance resultsNo changes detected ✅Current numbersThe percentage of diagnostics emitted that were expected errors held steady at 87.94%. The percentage of expected errors that received a diagnostic held steady at 83.36%. The number of fully passing files held steady at 79/133. |
Memory usage reportMemory usage unchanged ✅ |
|
| Lint rule | Added | Removed | Changed |
|---|---|---|---|
missing-typed-dict-key |
0 | 37 | 0 |
invalid-return-type |
0 | 5 | 0 |
| Total | 0 | 42 | 0 |
Raw diff (42 changes)
core (https://github.com/home-assistant/core)
- homeassistant/components/energy/data.py:786:20 error[missing-typed-dict-key] Missing required key 'stat_energy_from' in TypedDict `BatterySourceType` constructor
- homeassistant/components/energy/data.py:786:20 error[missing-typed-dict-key] Missing required key 'stat_energy_to' in TypedDict `BatterySourceType` constructor
- homeassistant/components/energy/data.py:786:20 error[missing-typed-dict-key] Missing required key 'type' in TypedDict `BatterySourceType` constructor
- homeassistant/components/energy/data.py:786:20 error[invalid-return-type] Return type does not match returned value: expected `BatterySourceType`, found `dict[str, Unknown | str]`
- homeassistant/components/energy/data.py:789:16 error[missing-typed-dict-key] Missing required key 'stat_energy_from' in TypedDict `BatterySourceType` constructor
- homeassistant/components/energy/data.py:789:16 error[missing-typed-dict-key] Missing required key 'stat_energy_to' in TypedDict `BatterySourceType` constructor
- homeassistant/components/energy/data.py:789:16 error[missing-typed-dict-key] Missing required key 'type' in TypedDict `BatterySourceType` constructor
- homeassistant/components/energy/data.py:789:16 error[invalid-return-type] Return type does not match returned value: expected `BatterySourceType`, found `dict[str, Unknown | str]`
- homeassistant/components/energy/data.py:804:20 error[missing-typed-dict-key] Missing required key 'cost_adjustment_day' in TypedDict `GridSourceType` constructor
- homeassistant/components/energy/data.py:804:20 error[missing-typed-dict-key] Missing required key 'entity_energy_price' in TypedDict `GridSourceType` constructor
- homeassistant/components/energy/data.py:804:20 error[missing-typed-dict-key] Missing required key 'entity_energy_price_export' in TypedDict `GridSourceType` constructor
- homeassistant/components/energy/data.py:804:20 error[missing-typed-dict-key] Missing required key 'number_energy_price' in TypedDict `GridSourceType` constructor
- homeassistant/components/energy/data.py:804:20 error[missing-typed-dict-key] Missing required key 'number_energy_price_export' in TypedDict `GridSourceType` constructor
- homeassistant/components/energy/data.py:804:20 error[missing-typed-dict-key] Missing required key 'stat_compensation' in TypedDict `GridSourceType` constructor
- homeassistant/components/energy/data.py:804:20 error[missing-typed-dict-key] Missing required key 'stat_cost' in TypedDict `GridSourceType` constructor
- homeassistant/components/energy/data.py:804:20 error[missing-typed-dict-key] Missing required key 'stat_energy_from' in TypedDict `GridSourceType` constructor
- homeassistant/components/energy/data.py:804:20 error[missing-typed-dict-key] Missing required key 'stat_energy_to' in TypedDict `GridSourceType` constructor
- homeassistant/components/energy/data.py:804:20 error[missing-typed-dict-key] Missing required key 'type' in TypedDict `GridSourceType` constructor
- homeassistant/components/energy/data.py:804:20 error[invalid-return-type] Return type does not match returned value: expected `GridSourceType`, found `dict[str, Unknown | str]`
- homeassistant/components/energy/data.py:807:16 error[missing-typed-dict-key] Missing required key 'cost_adjustment_day' in TypedDict `GridSourceType` constructor
- homeassistant/components/energy/data.py:807:16 error[missing-typed-dict-key] Missing required key 'entity_energy_price' in TypedDict `GridSourceType` constructor
- homeassistant/components/energy/data.py:807:16 error[missing-typed-dict-key] Missing required key 'entity_energy_price_export' in TypedDict `GridSourceType` constructor
- homeassistant/components/energy/data.py:807:16 error[missing-typed-dict-key] Missing required key 'number_energy_price' in TypedDict `GridSourceType` constructor
- homeassistant/components/energy/data.py:807:16 error[missing-typed-dict-key] Missing required key 'number_energy_price_export' in TypedDict `GridSourceType` constructor
- homeassistant/components/energy/data.py:807:16 error[missing-typed-dict-key] Missing required key 'stat_compensation' in TypedDict `GridSourceType` constructor
- homeassistant/components/energy/data.py:807:16 error[missing-typed-dict-key] Missing required key 'stat_cost' in TypedDict `GridSourceType` constructor
- homeassistant/components/energy/data.py:807:16 error[missing-typed-dict-key] Missing required key 'stat_energy_from' in TypedDict `GridSourceType` constructor
- homeassistant/components/energy/data.py:807:16 error[missing-typed-dict-key] Missing required key 'stat_energy_to' in TypedDict `GridSourceType` constructor
- homeassistant/components/energy/data.py:807:16 error[missing-typed-dict-key] Missing required key 'type' in TypedDict `GridSourceType` constructor
- homeassistant/components/energy/data.py:807:16 error[invalid-return-type] Return type does not match returned value: expected `GridSourceType`, found `dict[str, Unknown | str]`
pyjwt (https://github.com/jpadilla/pyjwt)
- jwt/api_jwt.py:88:16 error[missing-typed-dict-key] Missing required key 'enforce_minimum_key_length' in TypedDict `FullOptions` constructor
- jwt/api_jwt.py:88:16 error[missing-typed-dict-key] Missing required key 'require' in TypedDict `FullOptions` constructor
- jwt/api_jwt.py:88:16 error[missing-typed-dict-key] Missing required key 'strict_aud' in TypedDict `FullOptions` constructor
- jwt/api_jwt.py:88:16 error[missing-typed-dict-key] Missing required key 'verify_aud' in TypedDict `FullOptions` constructor
- jwt/api_jwt.py:88:16 error[missing-typed-dict-key] Missing required key 'verify_exp' in TypedDict `FullOptions` constructor
- jwt/api_jwt.py:88:16 error[missing-typed-dict-key] Missing required key 'verify_iat' in TypedDict `FullOptions` constructor
- jwt/api_jwt.py:88:16 error[missing-typed-dict-key] Missing required key 'verify_iss' in TypedDict `FullOptions` constructor
- jwt/api_jwt.py:88:16 error[missing-typed-dict-key] Missing required key 'verify_jti' in TypedDict `FullOptions` constructor
- jwt/api_jwt.py:88:16 error[missing-typed-dict-key] Missing required key 'verify_nbf' in TypedDict `FullOptions` constructor
- jwt/api_jwt.py:88:16 error[missing-typed-dict-key] Missing required key 'verify_signature' in TypedDict `FullOptions` constructor
- jwt/api_jwt.py:88:16 error[missing-typed-dict-key] Missing required key 'verify_sub' in TypedDict `FullOptions` constructor
- jwt/api_jwt.py:88:16 error[invalid-return-type] Return type does not match returned value: expected `FullOptions`, found `dict[str, Unknown]`
Merging this PR will degrade performance by 4.59%
Performance Changes
Comparing Footnotes
|
7b49ce5 to
10f4c9a
Compare
This was referenced Apr 27, 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
We already support
**unpacking ofTypedDictin namedTypedDictconstructors; this PR extends it to literals annotated asTypedDict, as in:Closes astral-sh/ty#1493