Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[ty] Check implicit open TypedDict extra items#25628

Merged
charliermarsh merged 7 commits into
mainfrom
charlie/implicit-open-typeddict-kwargs
Jun 5, 2026
Merged

[ty] Check implicit open TypedDict extra items#25628
charliermarsh merged 7 commits into
mainfrom
charlie/implicit-open-typeddict-kwargs

Conversation

@charliermarsh

Copy link
Copy Markdown
Member

Summary

Open TypedDict values can contain hidden extra items with value type object. This updates call binding to account for those possible values when a **TypedDict argument is matched against a keyword-variadic parameter, while continuing to ignore hidden items for callees without **kwargs.

This means calls like the following now reject the possible hidden extra items instead of only checking the declared keys:

class Options(TypedDict):
    name: str

def accepts_ints(name: str, **kwargs: int) -> None: ...

accepts_ints(**Options(name="x"))  # Expected `int`, found `object`

The same implicit-open behavior also means functools.partial(..., **typed_dict) cannot be normalized to a precise reduced signature, because hidden extra items may bind additional keywords at runtime. We now fall back to the broad partial[ReturnType] form for those calls, matching Pyright for ordinary open TypedDicts.

@astral-sh-bot astral-sh-bot Bot added the ty Multi-file analysis & type inference label Jun 4, 2026
@astral-sh-bot

astral-sh-bot Bot commented Jun 4, 2026

Copy link
Copy Markdown

Typing conformance results

No changes detected ✅

Current numbers
The percentage of diagnostics emitted that were expected errors held steady at 92.13%. The percentage of expected errors that received a diagnostic held steady at 87.18%. The number of fully passing files held steady at 92/134.

@astral-sh-bot

astral-sh-bot Bot commented Jun 4, 2026

Copy link
Copy Markdown

Memory usage report

Memory usage unchanged ✅

@astral-sh-bot

astral-sh-bot Bot commented Jun 4, 2026

Copy link
Copy Markdown

ecosystem-analyzer results

Lint rule Added Removed Changed
invalid-argument-type 79 12 8
Total 79 12 8
Raw diff (99 changes)
core (https://github.com/home-assistant/core)
- homeassistant/components/aprilaire/coordinator.py:104:21 error[invalid-argument-type] Argument to bound method `DeviceRegistry.async_update_device` is incorrect: Expected `DeviceEntryType | None | UndefinedType`, found `set[tuple[str, str]]`
- homeassistant/components/aprilaire/coordinator.py:104:21 error[invalid-argument-type] Argument to bound method `DeviceRegistry.async_update_device` is incorrect: Expected `str | None | UndefinedType`, found `set[tuple[str, str]]`
+ homeassistant/helpers/condition.py:1172:46 error[invalid-argument-type] Argument to bound method `ConditionChecker.async_check` is incorrect: Possible extra items in unpacked open `TypedDict` have type `object`, expected `Never`
+ homeassistant/helpers/condition.py:1206:46 error[invalid-argument-type] Argument to bound method `ConditionChecker.async_check` is incorrect: Possible extra items in unpacked open `TypedDict` have type `object`, expected `Never`
+ homeassistant/helpers/condition.py:1240:46 error[invalid-argument-type] Argument to bound method `ConditionChecker.async_check` is incorrect: Possible extra items in unpacked open `TypedDict` have type `object`, expected `Never`

discord.py (https://github.com/Rapptz/discord.py)
- discord/ext/commands/core.py:602:38 error[invalid-argument-type] Argument to `Command.__init__` is incorrect: Expected `CooldownMapping[Context[Any]]`, found `Any | list[str] | tuple[str, ...] | ... omitted 7 union elements`
+ discord/ext/commands/core.py:602:38 error[invalid-argument-type] Argument to `Command.__init__` is incorrect: Expected `CooldownMapping[Context[Any]]`, found `object`
- discord/ext/commands/core.py:602:38 error[invalid-argument-type] Argument to `Command.__init__` is incorrect: Expected `MaxConcurrency`, found `Any | list[str] | tuple[str, ...] | ... omitted 7 union elements`
+ discord/ext/commands/core.py:602:38 error[invalid-argument-type] Argument to `Command.__init__` is incorrect: Expected `MaxConcurrency`, found `object`
- discord/ext/commands/core.py:602:38 error[invalid-argument-type] Argument to `Command.__init__` is incorrect: Expected `bool`, found `Any | list[str] | tuple[str, ...] | ... omitted 7 union elements`
+ discord/ext/commands/core.py:602:38 error[invalid-argument-type] Argument to `Command.__init__` is incorrect: Expected `bool`, found `object`
- discord/ext/commands/core.py:602:38 error[invalid-argument-type] Argument to `Command.__init__` is incorrect: Expected `bool`, found `Any | list[str] | tuple[str, ...] | ... omitted 7 union elements`
+ discord/ext/commands/core.py:602:38 error[invalid-argument-type] Argument to `Command.__init__` is incorrect: Expected `dict[Any, Any]`, found `object`
- discord/ext/commands/core.py:602:38 error[invalid-argument-type] Argument to `Command.__init__` is incorrect: Expected `bool`, found `Any | list[str] | tuple[str, ...] | ... omitted 7 union elements`
+ discord/ext/commands/core.py:602:38 error[invalid-argument-type] Argument to `Command.__init__` is incorrect: Expected `list[(Context[Any], /) -> bool | Coroutine[Any, Any, bool]]`, found `object`
- discord/ext/commands/core.py:602:38 error[invalid-argument-type] Argument to `Command.__init__` is incorrect: Expected `bool`, found `Any | list[str] | tuple[str, ...] | ... omitted 7 union elements`
+ discord/ext/commands/core.py:602:38 error[invalid-argument-type] Argument to `Command.__init__` is incorrect: Expected `list[str] | tuple[str, ...]`, found `object`
- discord/ext/commands/core.py:602:38 error[invalid-argument-type] Argument to `Command.__init__` is incorrect: Expected `bool`, found `Any | list[str] | tuple[str, ...] | ... omitted 7 union elements`
+ discord/ext/commands/core.py:602:38 error[invalid-argument-type] Argument to `Command.__init__` is incorrect: Expected `str | None`, found `object`
- discord/ext/commands/core.py:602:38 error[invalid-argument-type] Argument to `Command.__init__` is incorrect: Expected `bool`, found `Any | list[str] | tuple[str, ...] | ... omitted 7 union elements`
+ discord/ext/commands/core.py:602:38 error[invalid-argument-type] Argument to `Command.__init__` is incorrect: Expected `str`, found `object`
- discord/ext/commands/core.py:602:38 error[invalid-argument-type] Argument to `Command.__init__` is incorrect: Expected `dict[Any, Any]`, found `Any | list[str] | tuple[str, ...] | ... omitted 7 union elements`
- discord/ext/commands/core.py:602:38 error[invalid-argument-type] Argument to `Command.__init__` is incorrect: Expected `list[(Context[Any], /) -> bool | Coroutine[Any, Any, bool]]`, found `Any | list[str] | tuple[str, ...] | ... omitted 7 union elements`
- discord/ext/commands/core.py:602:38 error[invalid-argument-type] Argument to `Command.__init__` is incorrect: Expected `list[str] | tuple[str, ...]`, found `Any | list[str] | tuple[str, ...] | ... omitted 7 union elements`
- discord/ext/commands/core.py:602:38 error[invalid-argument-type] Argument to `Command.__init__` is incorrect: Expected `str | None`, found `Any | list[str] | tuple[str, ...] | ... omitted 7 union elements`
- discord/ext/commands/core.py:602:38 error[invalid-argument-type] Argument to `Command.__init__` is incorrect: Expected `str | None`, found `Any | list[str] | tuple[str, ...] | ... omitted 7 union elements`
- discord/ext/commands/core.py:602:38 error[invalid-argument-type] Argument to `Command.__init__` is incorrect: Expected `str | None`, found `Any | list[str] | tuple[str, ...] | ... omitted 7 union elements`
- discord/ext/commands/core.py:602:38 error[invalid-argument-type] Argument to `Command.__init__` is incorrect: Expected `str`, found `Any | list[str] | tuple[str, ...] | ... omitted 7 union elements`
- discord/ext/commands/core.py:602:38 error[invalid-argument-type] Argument to `Command.__init__` is incorrect: Expected `str`, found `Any | list[str] | tuple[str, ...] | ... omitted 7 union elements`

rotki (https://github.com/rotki/rotki)
- rotkehlchen/history/events/structures/solana_swap.py:111:17 error[invalid-argument-type] Argument to `SolanaSwapEvent.__init__` is incorrect: Expected `TimestampMS`, found `str | None`
- rotkehlchen/history/events/structures/solana_swap.py:111:17 error[invalid-argument-type] Argument to `SolanaSwapEvent.__init__` is incorrect: Expected `str | None`, found `Location`

zulip (https://github.com/zulip/zulip)
+ zerver/tests/test_scim.py:100:72 error[invalid-argument-type] Argument to bound method `ZulipTestCaseMixin.client_get` is incorrect: Possible extra items in unpacked open `TypedDict` have type `object`, expected `str`
+ zerver/tests/test_scim.py:109:68 error[invalid-argument-type] Argument to bound method `ZulipTestCaseMixin.client_get` is incorrect: Possible extra items in unpacked open `TypedDict` have type `object`, expected `str`
+ zerver/tests/test_scim.py:126:60 error[invalid-argument-type] Argument to bound method `ZulipTestCaseMixin.client_get` is incorrect: Possible extra items in unpacked open `TypedDict` have type `object`, expected `str`
+ zerver/tests/test_scim.py:159:69 error[invalid-argument-type] Argument to bound method `ZulipTestCaseMixin.client_get` is incorrect: Possible extra items in unpacked open `TypedDict` have type `object`, expected `str`
+ zerver/tests/test_scim.py:179:13 error[invalid-argument-type] Argument to bound method `ZulipTestCaseMixin.client_get` is incorrect: Possible extra items in unpacked open `TypedDict` have type `object`, expected `str`
+ zerver/tests/test_scim.py:193:13 error[invalid-argument-type] Argument to bound method `ZulipTestCaseMixin.client_get` is incorrect: Possible extra items in unpacked open `TypedDict` have type `object`, expected `str`
+ zerver/tests/test_scim.py:229:13 error[invalid-argument-type] Argument to bound method `ZulipTestCaseMixin.client_get` is incorrect: Possible extra items in unpacked open `TypedDict` have type `object`, expected `str`
+ zerver/tests/test_scim.py:238:60 error[invalid-argument-type] Argument to bound method `ZulipTestCaseMixin.client_get` is incorrect: Possible extra items in unpacked open `TypedDict` have type `object`, expected `str`
+ zerver/tests/test_scim.py:259:56 error[invalid-argument-type] Argument to bound method `ZulipTestCaseMixin.client_get` is incorrect: Possible extra items in unpacked open `TypedDict` have type `object`, expected `str`
+ zerver/tests/test_scim.py:285:73 error[invalid-argument-type] Argument to bound method `ZulipTestCaseMixin.client_get` is incorrect: Possible extra items in unpacked open `TypedDict` have type `object`, expected `str`
+ zerver/tests/test_scim.py:296:73 error[invalid-argument-type] Argument to bound method `ZulipTestCaseMixin.client_get` is incorrect: Possible extra items in unpacked open `TypedDict` have type `object`, expected `str`
+ zerver/tests/test_scim.py:318:13 error[invalid-argument-type] Argument to bound method `ZulipTestCaseMixin.client_post` is incorrect: Possible extra items in unpacked open `TypedDict` have type `object`, expected `str`
+ zerver/tests/test_scim.py:352:73 error[invalid-argument-type] Argument to bound method `ZulipTestCaseMixin.client_post` is incorrect: Possible extra items in unpacked open `TypedDict` have type `object`, expected `str`
+ zerver/tests/test_scim.py:384:73 error[invalid-argument-type] Argument to bound method `ZulipTestCaseMixin.client_post` is incorrect: Possible extra items in unpacked open `TypedDict` have type `object`, expected `str`
+ zerver/tests/test_scim.py:398:73 error[invalid-argument-type] Argument to bound method `ZulipTestCaseMixin.client_post` is incorrect: Possible extra items in unpacked open `TypedDict` have type `object`, expected `str`
+ zerver/tests/test_scim.py:429:77 error[invalid-argument-type] Argument to bound method `ZulipTestCaseMixin.client_post` is incorrect: Possible extra items in unpacked open `TypedDict` have type `object`, expected `str`
+ zerver/tests/test_scim.py:457:77 error[invalid-argument-type] Argument to bound method `ZulipTestCaseMixin.client_post` is incorrect: Possible extra items in unpacked open `TypedDict` have type `object`, expected `str`
+ zerver/tests/test_scim.py:487:73 error[invalid-argument-type] Argument to bound method `ZulipTestCaseMixin.client_post` is incorrect: Possible extra items in unpacked open `TypedDict` have type `object`, expected `str`
+ zerver/tests/test_scim.py:500:73 error[invalid-argument-type] Argument to bound method `ZulipTestCaseMixin.client_post` is incorrect: Possible extra items in unpacked open `TypedDict` have type `object`, expected `str`
+ zerver/tests/test_scim.py:521:73 error[invalid-argument-type] Argument to bound method `ZulipTestCaseMixin.client_post` is incorrect: Possible extra items in unpacked open `TypedDict` have type `object`, expected `str`
+ zerver/tests/test_scim.py:546:73 error[invalid-argument-type] Argument to bound method `ZulipTestCaseMixin.client_post` is incorrect: Possible extra items in unpacked open `TypedDict` have type `object`, expected `str`
+ zerver/tests/test_scim.py:573:13 error[invalid-argument-type] Argument to bound method `ZulipTestCaseMixin.client_post` is incorrect: Possible extra items in unpacked open `TypedDict` have type `object`, expected `str`
+ zerver/tests/test_scim.py:579:72 error[invalid-argument-type] Argument to bound method `ZulipTestCaseMixin.client_delete` is incorrect: Possible extra items in unpacked open `TypedDict` have type `object`, expected `str`
+ zerver/tests/test_scim.py:607:72 error[invalid-argument-type] Argument to bound method `ZulipTestCaseMixin.json_put` is incorrect: Possible extra items in unpacked open `TypedDict` have type `object`, expected `str`
+ zerver/tests/test_scim.py:634:72 error[invalid-argument-type] Argument to bound method `ZulipTestCaseMixin.json_put` is incorrect: Possible extra items in unpacked open `TypedDict` have type `object`, expected `str`
+ zerver/tests/test_scim.py:661:72 error[invalid-argument-type] Argument to bound method `ZulipTestCaseMixin.json_put` is incorrect: Possible extra items in unpacked open `TypedDict` have type `object`, expected `str`
+ zerver/tests/test_scim.py:678:72 error[invalid-argument-type] Argument to bound method `ZulipTestCaseMixin.json_put` is incorrect: Possible extra items in unpacked open `TypedDict` have type `object`, expected `str`
+ zerver/tests/test_scim.py:697:72 error[invalid-argument-type] Argument to bound method `ZulipTestCaseMixin.json_put` is incorrect: Possible extra items in unpacked open `TypedDict` have type `object`, expected `str`
+ zerver/tests/test_scim.py:705:72 error[invalid-argument-type] Argument to bound method `ZulipTestCaseMixin.json_put` is incorrect: Possible extra items in unpacked open `TypedDict` have type `object`, expected `str`
+ zerver/tests/test_scim.py:719:74 error[invalid-argument-type] Argument to bound method `ZulipTestCaseMixin.json_patch` is incorrect: Possible extra items in unpacked open `TypedDict` have type `object`, expected `str`
+ zerver/tests/test_scim.py:738:74 error[invalid-argument-type] Argument to bound method `ZulipTestCaseMixin.json_patch` is incorrect: Possible extra items in unpacked open `TypedDict` have type `object`, expected `str`
+ zerver/tests/test_scim.py:763:74 error[invalid-argument-type] Argument to bound method `ZulipTestCaseMixin.json_patch` is incorrect: Possible extra items in unpacked open `TypedDict` have type `object`, expected `str`
+ zerver/tests/test_scim.py:781:74 error[invalid-argument-type] Argument to bound method `ZulipTestCaseMixin.json_patch` is incorrect: Possible extra items in unpacked open `TypedDict` have type `object`, expected `str`
+ zerver/tests/test_scim.py:795:74 error[invalid-argument-type] Argument to bound method `ZulipTestCaseMixin.json_patch` is incorrect: Possible extra items in unpacked open `TypedDict` have type `object`, expected `str`
+ zerver/tests/test_scim.py:806:74 error[invalid-argument-type] Argument to bound method `ZulipTestCaseMixin.json_patch` is incorrect: Possible extra items in unpacked open `TypedDict` have type `object`, expected `str`
+ zerver/tests/test_scim.py:820:78 error[invalid-argument-type] Argument to bound method `ZulipTestCaseMixin.json_patch` is incorrect: Possible extra items in unpacked open `TypedDict` have type `object`, expected `str`
+ zerver/tests/test_scim.py:836:73 error[invalid-argument-type] Argument to bound method `ZulipTestCaseMixin.client_get` is incorrect: Possible extra items in unpacked open `TypedDict` have type `object`, expected `str`
+ zerver/tests/test_scim.py:856:77 error[invalid-argument-type] Argument to bound method `ZulipTestCaseMixin.client_post` is incorrect: Possible extra items in unpacked open `TypedDict` have type `object`, expected `str`
+ zerver/tests/test_scim.py:892:76 error[invalid-argument-type] Argument to bound method `ZulipTestCaseMixin.json_put` is incorrect: Possible extra items in unpacked open `TypedDict` have type `object`, expected `str`
+ zerver/tests/test_scim.py:918:78 error[invalid-argument-type] Argument to bound method `ZulipTestCaseMixin.json_patch` is incorrect: Possible extra items in unpacked open `TypedDict` have type `object`, expected `str`
+ zerver/tests/test_scim.py:941:78 error[invalid-argument-type] Argument to bound method `ZulipTestCaseMixin.json_patch` is incorrect: Possible extra items in unpacked open `TypedDict` have type `object`, expected `str`
+ zerver/tests/test_scim.py:965:73 error[invalid-argument-type] Argument to bound method `ZulipTestCaseMixin.client_get` is incorrect: Possible extra items in unpacked open `TypedDict` have type `object`, expected `str`
+ zerver/tests/test_scim.py:990:76 error[invalid-argument-type] Argument to bound method `ZulipTestCaseMixin.json_put` is incorrect: Possible extra items in unpacked open `TypedDict` have type `object`, expected `str`
+ zerver/tests/test_scim.py:1013:77 error[invalid-argument-type] Argument to bound method `ZulipTestCaseMixin.client_post` is incorrect: Possible extra items in unpacked open `TypedDict` have type `object`, expected `str`
+ zerver/tests/test_scim.py:1046:76 error[invalid-argument-type] Argument to bound method `ZulipTestCaseMixin.json_put` is incorrect: Possible extra items in unpacked open `TypedDict` have type `object`, expected `str`
+ zerver/tests/test_scim.py:1081:76 error[invalid-argument-type] Argument to bound method `ZulipTestCaseMixin.json_put` is incorrect: Possible extra items in unpacked open `TypedDict` have type `object`, expected `str`
+ zerver/tests/test_scim.py:1104:77 error[invalid-argument-type] Argument to bound method `ZulipTestCaseMixin.client_post` is incorrect: Possible extra items in unpacked open `TypedDict` have type `object`, expected `str`
+ zerver/tests/test_scim.py:1130:73 error[invalid-argument-type] Argument to bound method `ZulipTestCaseMixin.client_post` is incorrect: Possible extra items in unpacked open `TypedDict` have type `object`, expected `str`
+ zerver/tests/test_scim.py:1213:13 error[invalid-argument-type] Argument to bound method `ZulipTestCaseMixin.client_get` is incorrect: Possible extra items in unpacked open `TypedDict` have type `object`, expected `str`
+ zerver/tests/test_scim.py:1233:13 error[invalid-argument-type] Argument to bound method `ZulipTestCaseMixin.client_get` is incorrect: Possible extra items in unpacked open `TypedDict` have type `object`, expected `str`
+ zerver/tests/test_scim.py:1243:61 error[invalid-argument-type] Argument to bound method `ZulipTestCaseMixin.client_get` is incorrect: Possible extra items in unpacked open `TypedDict` have type `object`, expected `str`
+ zerver/tests/test_scim.py:1262:57 error[invalid-argument-type] Argument to bound method `ZulipTestCaseMixin.client_get` is incorrect: Possible extra items in unpacked open `TypedDict` have type `object`, expected `str`
+ zerver/tests/test_scim.py:1283:74 error[invalid-argument-type] Argument to bound method `ZulipTestCaseMixin.client_post` is incorrect: Possible extra items in unpacked open `TypedDict` have type `object`, expected `str`
+ zerver/tests/test_scim.py:1304:74 error[invalid-argument-type] Argument to bound method `ZulipTestCaseMixin.client_post` is incorrect: Possible extra items in unpacked open `TypedDict` have type `object`, expected `str`
+ zerver/tests/test_scim.py:1325:74 error[invalid-argument-type] Argument to bound method `ZulipTestCaseMixin.client_post` is incorrect: Possible extra items in unpacked open `TypedDict` have type `object`, expected `str`
+ zerver/tests/test_scim.py:1800:74 error[invalid-argument-type] Argument to bound method `ZulipTestCaseMixin.client_post` is incorrect: Possible extra items in unpacked open `TypedDict` have type `object`, expected `str`
+ zerver/tests/test_scim.py:1818:17 error[invalid-argument-type] Argument to bound method `ZulipTestCaseMixin.client_post` is incorrect: Possible extra items in unpacked open `TypedDict` have type `object`, expected `str`
+ zerver/tests/test_scim.py:1856:51 error[invalid-argument-type] Argument to bound method `ZulipTestCaseMixin.client_get` is incorrect: Possible extra items in unpacked open `TypedDict` have type `object`, expected `str`
+ zerver/tests/test_scim.py:1185:74 error[invalid-argument-type] Argument to bound method `ZulipTestCaseMixin.client_get` is incorrect: Possible extra items in unpacked open `TypedDict` have type `object`, expected `str`
+ zerver/tests/test_scim.py:1356:77 error[invalid-argument-type] Argument to bound method `ZulipTestCaseMixin.json_put` is incorrect: Possible extra items in unpacked open `TypedDict` have type `object`, expected `str`
+ zerver/tests/test_scim.py:1377:77 error[invalid-argument-type] Argument to bound method `ZulipTestCaseMixin.json_put` is incorrect: Possible extra items in unpacked open `TypedDict` have type `object`, expected `str`
+ zerver/tests/test_scim.py:1397:77 error[invalid-argument-type] Argument to bound method `ZulipTestCaseMixin.json_put` is incorrect: Possible extra items in unpacked open `TypedDict` have type `object`, expected `str`
+ zerver/tests/test_scim.py:1438:79 error[invalid-argument-type] Argument to bound method `ZulipTestCaseMixin.json_patch` is incorrect: Possible extra items in unpacked open `TypedDict` have type `object`, expected `str`
+ zerver/tests/test_scim.py:1468:79 error[invalid-argument-type] Argument to bound method `ZulipTestCaseMixin.json_patch` is incorrect: Possible extra items in unpacked open `TypedDict` have type `object`, expected `str`
+ zerver/tests/test_scim.py:1502:79 error[invalid-argument-type] Argument to bound method `ZulipTestCaseMixin.json_patch` is incorrect: Possible extra items in unpacked open `TypedDict` have type `object`, expected `str`
+ zerver/tests/test_scim.py:1537:79 error[invalid-argument-type] Argument to bound method `ZulipTestCaseMixin.json_patch` is incorrect: Possible extra items in unpacked open `TypedDict` have type `object`, expected `str`
+ zerver/tests/test_scim.py:1563:79 error[invalid-argument-type] Argument to bound method `ZulipTestCaseMixin.json_patch` is incorrect: Possible extra items in unpacked open `TypedDict` have type `object`, expected `str`
+ zerver/tests/test_scim.py:1587:79 error[invalid-argument-type] Argument to bound method `ZulipTestCaseMixin.json_patch` is incorrect: Possible extra items in unpacked open `TypedDict` have type `object`, expected `str`
+ zerver/tests/test_scim.py:1608:79 error[invalid-argument-type] Argument to bound method `ZulipTestCaseMixin.json_patch` is incorrect: Possible extra items in unpacked open `TypedDict` have type `object`, expected `str`
+ zerver/tests/test_scim.py:1636:79 error[invalid-argument-type] Argument to bound method `ZulipTestCaseMixin.json_patch` is incorrect: Possible extra items in unpacked open `TypedDict` have type `object`, expected `str`
+ zerver/tests/test_scim.py:1671:79 error[invalid-argument-type] Argument to bound method `ZulipTestCaseMixin.json_patch` is incorrect: Possible extra items in unpacked open `TypedDict` have type `object`, expected `str`
+ zerver/tests/test_scim.py:1695:79 error[invalid-argument-type] Argument to bound method `ZulipTestCaseMixin.json_patch` is incorrect: Possible extra items in unpacked open `TypedDict` have type `object`, expected `str`
+ zerver/tests/test_scim.py:1736:79 error[invalid-argument-type] Argument to bound method `ZulipTestCaseMixin.json_patch` is incorrect: Possible extra items in unpacked open `TypedDict` have type `object`, expected `str`
+ zerver/tests/test_scim.py:1767:60 error[invalid-argument-type] Argument to bound method `ZulipTestCaseMixin.json_patch` is incorrect: Possible extra items in unpacked open `TypedDict` have type `object`, expected `str`
+ zerver/tests/test_scim.py:1780:75 error[invalid-argument-type] Argument to bound method `ZulipTestCaseMixin.client_delete` is incorrect: Possible extra items in unpacked open `TypedDict` have type `object`, expected `str`
+ zerver/tests/test_scim.py:1837:77 error[invalid-argument-type] Argument to bound method `ZulipTestCaseMixin.client_delete` is incorrect: Possible extra items in unpacked open `TypedDict` have type `object`, expected `str`

Full report with detailed diff (timing results)

@charliermarsh charliermarsh marked this pull request as ready for review June 4, 2026 13:16
@charliermarsh

Copy link
Copy Markdown
Member Author

I think the ecosystem diagnostics here look worse than they are -- it's effectively all in Zulip where they have this pattern: https://github.com/zulip/zulip/blob/102e6a16817ef5c60e07354776bb1308ef37a28e/zerver/lib/test_classes.py#L572

@charliermarsh charliermarsh force-pushed the charlie/implicit-open-typeddict-kwargs branch from fc6864b to ffdde41 Compare June 4, 2026 18:08

@carljm carljm left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

I think I'd prefer not to land this with the implicit ordering-based provenance; other comments up to your discretion to address or defer.


kwargs: MyKwargs = {"b": "hello"}
p = partial(f, **kwargs)
reveal_type(p) # revealed: partial[(a: int, *, b: str = ...) -> bool]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tempted to say rather than losing these details, we should (in this PR) duplicate these partial tests with a closed TypedDict and add TODO comments for what the precise result should be in that case.

Comment thread crates/ty_python_semantic/src/types/call/arguments.rs Outdated
Comment thread crates/ty_python_semantic/resources/mdtest/call/function.md Outdated
Comment thread crates/ty_python_semantic/src/types/call/bind.rs Outdated
Comment thread crates/ty_python_semantic/src/types/call/bind.rs
Comment thread crates/ty_python_semantic/resources/mdtest/call/function.md
Comment thread crates/ty_python_semantic/src/types/call/bind.rs Outdated
Comment thread crates/ty_python_semantic/src/types/call/bind.rs Outdated
@charliermarsh charliermarsh force-pushed the charlie/implicit-open-typeddict-kwargs branch from ffdde41 to f13268b Compare June 5, 2026 01:53
@charliermarsh charliermarsh enabled auto-merge (squash) June 5, 2026 01:55
@charliermarsh charliermarsh disabled auto-merge June 5, 2026 01:57
@charliermarsh charliermarsh merged commit 7c42951 into main Jun 5, 2026
57 of 58 checks passed
@charliermarsh charliermarsh deleted the charlie/implicit-open-typeddict-kwargs branch June 5, 2026 02:02
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.

2 participants