Skip to content

[ty] Support **{...} unpacking in TypedDict constructors#24523

Draft
charliermarsh wants to merge 2 commits intomainfrom
charlie/td-unpack
Draft

[ty] Support **{...} unpacking in TypedDict constructors#24523
charliermarsh wants to merge 2 commits intomainfrom
charlie/td-unpack

Conversation

@charliermarsh
Copy link
Copy Markdown
Member

No description provided.

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

astral-sh-bot Bot commented Apr 9, 2026

Typing conformance results

No changes detected ✅

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

@astral-sh-bot
Copy link
Copy Markdown

astral-sh-bot Bot commented Apr 9, 2026

Memory usage report

Memory usage unchanged ✅

@astral-sh-bot
Copy link
Copy Markdown

astral-sh-bot Bot commented Apr 9, 2026

ecosystem-analyzer results

Lint rule Added Removed Changed
missing-typed-dict-key 0 63 0
invalid-argument-type 31 0 0
invalid-return-type 1 5 0
invalid-key 1 0 0
Total 33 68 0
Raw diff (101 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]`
+ homeassistant/components/recorder/statistics.py:2616:12 error[invalid-return-type] Return type does not match returned value: expected `list[StatisticsRow]`, found `list[StatisticsRow | dict[str, Any | None | int | float]]`
+ homeassistant/components/recorder/statistics.py:2620:15 error[invalid-argument-type] Invalid argument to key "end" with declared type `int | float` on TypedDict `StatisticsRow`: value of type `None | int | float`
+ homeassistant/components/recorder/statistics.py:2620:15 error[invalid-argument-type] Invalid argument to key "start" with declared type `int | float` on TypedDict `StatisticsRow`: value of type `None | int | float`

cwltool (https://github.com/common-workflow-language/cwltool)
- tests/test_parallel.py:22:21 error[missing-typed-dict-key] Missing required key 'class' in TypedDict `CWLFileType` constructor
- tests/test_pathmapper.py:95:15 error[missing-typed-dict-key] Missing required key 'class' in TypedDict `CWLFileType` constructor
- cwltool/builder.py:478:41 error[missing-typed-dict-key] Missing required key 'class' in TypedDict `CWLFileType` constructor
- cwltool/command_line_tool.py:692:25 error[missing-typed-dict-key] Missing required key 'class' in TypedDict `CWLFileType` constructor
- cwltool/command_line_tool.py:1024:37 error[missing-typed-dict-key] Missing required key 'class' in TypedDict `CWLFileType` constructor
+ cwltool/command_line_tool.py:697:25 error[invalid-key] Unknown key "writable" for TypedDict `CWLFileType`
- cwltool/job.py:141:30 error[missing-typed-dict-key] Missing required key 'class' in TypedDict `CWLDirectoryType` constructor
- cwltool/main.py:597:12 error[missing-typed-dict-key] Missing required key 'class' in TypedDict `CWLFileType` constructor
- cwltool/process.py:1151:20 error[missing-typed-dict-key] Missing required key 'class' in TypedDict `CWLDirectoryType` constructor
- cwltool/process.py:1229:30 error[missing-typed-dict-key] Missing required key 'class' in TypedDict `CWLFileType` constructor
- cwltool/process.py:1237:28 error[missing-typed-dict-key] Missing required key 'class' in TypedDict `CWLFileType` constructor
- cwltool/process.py:1253:28 error[missing-typed-dict-key] Missing required key 'class' in TypedDict `CWLDirectoryType` constructor
- cwltool/process.py:1317:33 error[missing-typed-dict-key] Missing required key 'class' in TypedDict `CWLFileType` constructor
- cwltool/process.py:1341:28 error[missing-typed-dict-key] Missing required key 'class' in TypedDict `CWLFileType` constructor
- cwltool/utils.py:351:19 error[missing-typed-dict-key] Missing required key 'class' in TypedDict `CWLDirectoryType` constructor
- cwltool/utils.py:362:28 error[missing-typed-dict-key] Missing required key 'class' in TypedDict `CWLFileType` constructor
- tests/test_examples.py:623:9 error[missing-typed-dict-key] Missing required key 'class' in TypedDict `CWLFileType` constructor
- tests/test_examples.py:624:9 error[missing-typed-dict-key] Missing required key 'class' in TypedDict `CWLFileType` constructor
- tests/test_examples.py:625:9 error[missing-typed-dict-key] Missing required key 'class' in TypedDict `CWLFileType` constructor
- tests/test_examples.py:626:9 error[missing-typed-dict-key] Missing required key 'class' in TypedDict `CWLDirectoryType` constructor
- tests/test_examples.py:636:9 error[missing-typed-dict-key] Missing required key 'class' in TypedDict `CWLFileType` constructor
- tests/test_examples.py:637:9 error[missing-typed-dict-key] Missing required key 'class' in TypedDict `CWLDirectoryType` constructor
- tests/test_http_input.py:17:9 error[missing-typed-dict-key] Missing required key 'class' in TypedDict `CWLFileType` constructor
- tests/test_http_input.py:61:13 error[missing-typed-dict-key] Missing required key 'class' in TypedDict `CWLFileType` constructor
- tests/test_js_sandbox.py:45:12 error[missing-typed-dict-key] Missing required key 'class' in TypedDict `CWLFileType` constructor
- tests/test_js_sandbox.py:91:16 error[missing-typed-dict-key] Missing required key 'class' in TypedDict `CWLFileType` constructor
- tests/test_js_sandbox.py:116:16 error[missing-typed-dict-key] Missing required key 'class' in TypedDict `CWLFileType` constructor

pydantic (https://github.com/pydantic/pydantic)
+ pydantic/_internal/_config.py:202:15 error[invalid-argument-type] Invalid argument to key "allow_inf_nan" with declared type `bool` on TypedDict `CoreConfig`: value of type `str | int`
+ pydantic/_internal/_config.py:202:15 error[invalid-argument-type] Invalid argument to key "cache_strings" with declared type `bool | Literal["all", "keys", "none"]` on TypedDict `CoreConfig`: value of type `str | int`
+ pydantic/_internal/_config.py:202:15 error[invalid-argument-type] Invalid argument to key "coerce_numbers_to_str" with declared type `bool` on TypedDict `CoreConfig`: value of type `str | int`
+ pydantic/_internal/_config.py:202:15 error[invalid-argument-type] Invalid argument to key "extra_fields_behavior" with declared type `Literal["allow", "forbid", "ignore"]` on TypedDict `CoreConfig`: value of type `str | int`
+ pydantic/_internal/_config.py:202:15 error[invalid-argument-type] Invalid argument to key "from_attributes" with declared type `bool` on TypedDict `CoreConfig`: value of type `str | int`
+ pydantic/_internal/_config.py:202:15 error[invalid-argument-type] Invalid argument to key "hide_input_in_errors" with declared type `bool` on TypedDict `CoreConfig`: value of type `str | int`
+ pydantic/_internal/_config.py:202:15 error[invalid-argument-type] Invalid argument to key "loc_by_alias" with declared type `bool` on TypedDict `CoreConfig`: value of type `str | int`
+ pydantic/_internal/_config.py:202:15 error[invalid-argument-type] Invalid argument to key "polymorphic_serialization" with declared type `bool` on TypedDict `CoreConfig`: value of type `str | int`
+ pydantic/_internal/_config.py:202:15 error[invalid-argument-type] Invalid argument to key "regex_engine" with declared type `Literal["rust-regex", "python-re"]` on TypedDict `CoreConfig`: value of type `str | int`
+ pydantic/_internal/_config.py:202:15 error[invalid-argument-type] Invalid argument to key "revalidate_instances" with declared type `Literal["always", "never", "subclass-instances"]` on TypedDict `CoreConfig`: value of type `str | int`
+ pydantic/_internal/_config.py:202:15 error[invalid-argument-type] Invalid argument to key "ser_json_bytes" with declared type `Literal["utf8", "base64", "hex"]` on TypedDict `CoreConfig`: value of type `str | int`
+ pydantic/_internal/_config.py:202:15 error[invalid-argument-type] Invalid argument to key "ser_json_inf_nan" with declared type `Literal["null", "constants", "strings"]` on TypedDict `CoreConfig`: value of type `str | int`
+ pydantic/_internal/_config.py:202:15 error[invalid-argument-type] Invalid argument to key "ser_json_temporal" with declared type `Literal["iso8601", "seconds", "milliseconds"]` on TypedDict `CoreConfig`: value of type `str | int`
+ pydantic/_internal/_config.py:202:15 error[invalid-argument-type] Invalid argument to key "ser_json_timedelta" with declared type `Literal["iso8601", "float"]` on TypedDict `CoreConfig`: value of type `str | int`
+ pydantic/_internal/_config.py:202:15 error[invalid-argument-type] Invalid argument to key "serialize_by_alias" with declared type `bool` on TypedDict `CoreConfig`: value of type `str | int`
+ pydantic/_internal/_config.py:202:15 error[invalid-argument-type] Invalid argument to key "str_max_length" with declared type `int` on TypedDict `CoreConfig`: value of type `str | int`
+ pydantic/_internal/_config.py:202:15 error[invalid-argument-type] Invalid argument to key "str_min_length" with declared type `int` on TypedDict `CoreConfig`: value of type `str | int`
+ pydantic/_internal/_config.py:202:15 error[invalid-argument-type] Invalid argument to key "str_strip_whitespace" with declared type `bool` on TypedDict `CoreConfig`: value of type `str | int`
+ pydantic/_internal/_config.py:202:15 error[invalid-argument-type] Invalid argument to key "str_to_lower" with declared type `bool` on TypedDict `CoreConfig`: value of type `str | int`
+ pydantic/_internal/_config.py:202:15 error[invalid-argument-type] Invalid argument to key "str_to_upper" with declared type `bool` on TypedDict `CoreConfig`: value of type `str | int`
+ pydantic/_internal/_config.py:202:15 error[invalid-argument-type] Invalid argument to key "strict" with declared type `bool` on TypedDict `CoreConfig`: value of type `str | int`
+ pydantic/_internal/_config.py:202:15 error[invalid-argument-type] Invalid argument to key "title" with declared type `str` on TypedDict `CoreConfig`: value of type `str | int`
+ pydantic/_internal/_config.py:202:15 error[invalid-argument-type] Invalid argument to key "typed_dict_total" with declared type `bool` on TypedDict `CoreConfig`: value of type `str | int`
+ pydantic/_internal/_config.py:202:15 error[invalid-argument-type] Invalid argument to key "url_preserve_empty_path" with declared type `bool` on TypedDict `CoreConfig`: value of type `str | int`
+ pydantic/_internal/_config.py:202:15 error[invalid-argument-type] Invalid argument to key "val_json_bytes" with declared type `Literal["utf8", "base64", "hex"]` on TypedDict `CoreConfig`: value of type `str | int`
+ pydantic/_internal/_config.py:202:15 error[invalid-argument-type] Invalid argument to key "validate_by_alias" with declared type `bool` on TypedDict `CoreConfig`: value of type `str | int`
+ pydantic/_internal/_config.py:202:15 error[invalid-argument-type] Invalid argument to key "validate_by_name" with declared type `bool` on TypedDict `CoreConfig`: value of type `str | int`
+ pydantic/_internal/_config.py:202:15 error[invalid-argument-type] Invalid argument to key "validate_default" with declared type `bool` on TypedDict `CoreConfig`: value of type `str | int`
+ pydantic/_internal/_config.py:202:15 error[invalid-argument-type] Invalid argument to key "validation_error_cause" with declared type `bool` on TypedDict `CoreConfig`: value of type `str | int`

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]`

Full report with detailed diff (timing results)

Base automatically changed from charlie/td-duplicate to main April 14, 2026 22:15
@charliermarsh charliermarsh force-pushed the charlie/td-unpack branch 3 times, most recently from 5146df9 to 1a8a844 Compare April 15, 2026 01:54
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.

1 participant