[ty] Check implicit open TypedDict extra items#25628
Conversation
Typing conformance resultsNo changes detected ✅Current numbersThe 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. |
Memory usage reportMemory usage unchanged ✅ |
|
| 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`|
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 |
fc6864b to
ffdde41
Compare
carljm
left a comment
There was a problem hiding this comment.
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] |
There was a problem hiding this comment.
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.
ffdde41 to
f13268b
Compare
Summary
Open
TypedDictvalues can contain hidden extra items with value typeobject. This updates call binding to account for those possible values when a**TypedDictargument 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:
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 broadpartial[ReturnType]form for those calls, matching Pyright for ordinary openTypedDicts.