Skip to content

[ty] Narrow TypedDicts through isinstance(..., dict)#23946

Draft
charliermarsh wants to merge 43 commits intocharlie/td-specialize-2from
charlie/td-narrow
Draft

[ty] Narrow TypedDicts through isinstance(..., dict)#23946
charliermarsh wants to merge 43 commits intocharlie/td-specialize-2from
charlie/td-narrow

Conversation

@charliermarsh
Copy link
Copy Markdown
Member

@charliermarsh charliermarsh commented Mar 13, 2026

Summary

This PR implements a TypedDictTop type that is a supertype of all TypedDict types, and treated as assignable to Mapping[str, object].

With this type, isinstance(x, dict) and isinstance(x, MutableMapping) now generate a constraint that includes TypedDictTop, e.g., Top[dict[Unknown, Unknown]] | TypedDictTop.

Closes astral-sh/ty#1130.

Closes astral-sh/ty#2374.

@astral-sh-bot astral-sh-bot bot added the ty Multi-file analysis & type inference label Mar 13, 2026
@charliermarsh charliermarsh force-pushed the charlie/td-narrow branch 2 times, most recently from c93ef08 to 931ca14 Compare March 13, 2026 19:50
@astral-sh-bot
Copy link
Copy Markdown

astral-sh-bot bot commented Mar 13, 2026

Typing conformance results

No changes detected ✅

Current numbers
The percentage of diagnostics emitted that were expected errors held steady at 86.60%. The percentage of expected errors that received a diagnostic held steady at 81.47%. The number of fully passing files held steady at 69/132.

@astral-sh-bot
Copy link
Copy Markdown

astral-sh-bot bot commented Mar 13, 2026

mypy_primer results

Changes were detected when running on open source projects
pip (https://github.com/pypa/pip)
- src/pip/_vendor/dependency_groups/_implementation.py:149:56: error[invalid-argument-type] Argument is incorrect: Expected `str`, found `object`
- src/pip/_vendor/pkg_resources/__init__.py:2840:21: error[invalid-assignment] Object of type `dict_items[object, object]` is not assignable to `Iterable[tuple[str | None, Iterable[str]]]`
+ src/pip/_vendor/pkg_resources/__init__.py:2840:21: error[invalid-assignment] Object of type `dict_items[Unknown, Unknown] | dict_items[str, object]` is not assignable to `Iterable[tuple[str | None, Iterable[str]]]`
- Found 656 diagnostics
+ Found 655 diagnostics

spack (https://github.com/spack/spack)
- lib/spack/spack/vendor/jinja2/filters.py:219:50: error[invalid-assignment] Object of type `dict_items[object, object]` is not assignable to `Iterable[tuple[str, Any]]`
- Found 4471 diagnostics
+ Found 4470 diagnostics

werkzeug (https://github.com/pallets/werkzeug)
- src/werkzeug/_internal.py:42:12: error[invalid-return-type] Return type does not match returned value: expected `dict[str, Any]`, found `(Any & Top[dict[Unknown, Unknown]]) | dict[str, Any] | (Request & Top[dict[Unknown, Unknown]])`
+ src/werkzeug/_internal.py:42:12: error[invalid-return-type] Return type does not match returned value: expected `dict[str, Any]`, found `(Any & Top[dict[Unknown, Unknown]]) | dict[str, Any] | (Request & Top[dict[Unknown, Unknown]]) | (Any & Top[TypedDict])`
- src/werkzeug/http.py:362:18: error[not-subscriptable] Cannot subscript object of type `object` with no `__getitem__` method
- Found 386 diagnostics
+ Found 385 diagnostics

stone (https://github.com/dropbox/stone)
- stone/backends/python_rsrc/stone_serializers.py:788:52: error[invalid-argument-type] Argument to function `ensure_str` is incorrect: Expected `bytes | str`, found `object`
- Found 252 diagnostics
+ Found 251 diagnostics

jinja (https://github.com/pallets/jinja)
- src/jinja2/filters.py:169:48: error[invalid-assignment] Object of type `dict_items[object, object]` is not assignable to `Iterable[tuple[str, Any]]`
- Found 202 diagnostics
+ Found 201 diagnostics

pyjwt (https://github.com/jpadilla/pyjwt)
- jwt/jwks_client.py:145:35: error[invalid-argument-type] Argument to function `from_dict` is incorrect: Expected `dict[str, Any]`, found `(PyJWKSet & Top[dict[Unknown, Unknown]]) | (Any & Top[dict[Unknown, Unknown]])`
+ jwt/jwks_client.py:145:35: error[invalid-argument-type] Argument to function `from_dict` is incorrect: Expected `dict[str, Any]`, found `(PyJWKSet & Top[dict[Unknown, Unknown]]) | (Any & Top[dict[Unknown, Unknown]]) | (Any & Top[TypedDict])`

beartype (https://github.com/beartype/beartype)
- beartype/_util/func/utilfuncframe.py:1163:12: error[invalid-return-type] Return type does not match returned value: expected `dict[str, Any]`, found `Mapping[str, object] & Top[dict[Unknown, Unknown]]`
+ beartype/_util/func/utilfuncframe.py:1163:12: error[invalid-return-type] Return type does not match returned value: expected `dict[str, Any]`, found `(Mapping[str, object] & Top[dict[Unknown, Unknown]]) | Top[TypedDict]`

graphql-core (https://github.com/graphql-python/graphql-core)
- src/graphql/error/graphql_error.py:213:58: error[invalid-argument-type] Argument to function `getattr` is incorrect: Expected `str`, found `~Literal["original_error"]`
- src/graphql/error/graphql_error.py:213:77: error[invalid-argument-type] Argument to bound method `get` is incorrect: Expected `Never`, found `~Literal["original_error"]`
- src/graphql/execution/types.py:106:28: error[invalid-argument-type] Argument to bound method `get` is incorrect: Expected `Never`, found `Literal["data"]`
- src/graphql/execution/types.py:107:32: error[invalid-argument-type] Argument to bound method `get` is incorrect: Expected `Never`, found `Literal["errors"]`
- src/graphql/execution/types.py:108:32: error[invalid-argument-type] Argument to bound method `get` is incorrect: Expected `Never`, found `Literal["extensions"]`
- src/graphql/execution/types.py:193:27: error[invalid-argument-type] Argument to bound method `get` is incorrect: Expected `Never`, found `Literal["data"]`
- src/graphql/execution/types.py:194:32: error[invalid-argument-type] Argument to bound method `get` is incorrect: Expected `Never`, found `Literal["errors"]`
- src/graphql/execution/types.py:195:32: error[invalid-argument-type] Argument to bound method `get` is incorrect: Expected `Never`, found `Literal["pending"]`
- src/graphql/execution/types.py:196:32: error[invalid-argument-type] Argument to bound method `get` is incorrect: Expected `Never`, found `Literal["hasNext"]`
- src/graphql/execution/types.py:197:32: error[invalid-argument-type] Argument to bound method `get` is incorrect: Expected `Never`, found `Literal["extensions"]`
- src/graphql/execution/types.py:294:28: error[invalid-argument-type] Argument to bound method `get` is incorrect: Expected `Never`, found `Literal["hasNext"]`
- src/graphql/execution/types.py:295:32: error[invalid-argument-type] Argument to bound method `get` is incorrect: Expected `Never`, found `Literal["pending"]`
- src/graphql/execution/types.py:296:32: error[invalid-argument-type] Argument to bound method `get` is incorrect: Expected `Never`, found `Literal["incremental"]`
- src/graphql/execution/types.py:297:32: error[invalid-argument-type] Argument to bound method `get` is incorrect: Expected `Never`, found `Literal["completed"]`
- src/graphql/execution/types.py:298:32: error[invalid-argument-type] Argument to bound method `get` is incorrect: Expected `Never`, found `Literal["extensions"]`
- src/graphql/execution/types.py:411:27: error[invalid-argument-type] Argument to bound method `get` is incorrect: Expected `Never`, found `Literal["data"]`
- src/graphql/execution/types.py:412:31: error[invalid-argument-type] Argument to bound method `get` is incorrect: Expected `Never`, found `Literal["id"]`
- src/graphql/execution/types.py:413:32: error[invalid-argument-type] Argument to bound method `get` is incorrect: Expected `Never`, found `Literal["subPath"]`
- src/graphql/execution/types.py:414:32: error[invalid-argument-type] Argument to bound method `get` is incorrect: Expected `Never`, found `Literal["errors"]`
- src/graphql/execution/types.py:415:32: error[invalid-argument-type] Argument to bound method `get` is incorrect: Expected `Never`, found `Literal["extensions"]`
- src/graphql/execution/types.py:519:27: error[invalid-argument-type] Argument to bound method `get` is incorrect: Expected `Never`, found `Literal["items"]`
- src/graphql/execution/types.py:520:31: error[invalid-argument-type] Argument to bound method `get` is incorrect: Expected `Never`, found `Literal["id"]`
- src/graphql/execution/types.py:521:22: error[no-matching-overload] No overload of bound method `get` matches arguments
- src/graphql/execution/types.py:522:32: error[invalid-argument-type] Argument to bound method `get` is incorrect: Expected `Never`, found `Literal["errors"]`
- src/graphql/execution/types.py:523:22: error[no-matching-overload] No overload of bound method `get` matches arguments
- src/graphql/execution/types.py:617:27: error[invalid-argument-type] Argument to bound method `get` is incorrect: Expected `Never`, found `Literal["id"]`
- src/graphql/execution/types.py:618:32: error[invalid-argument-type] Argument to bound method `get` is incorrect: Expected `Never`, found `Literal["path"]`
- src/graphql/execution/types.py:619:32: error[invalid-argument-type] Argument to bound method `get` is incorrect: Expected `Never`, found `Literal["label"]`
- src/graphql/execution/types.py:669:30: error[invalid-argument-type] Argument to bound method `get` is incorrect: Expected `Never`, found `Literal["id"]`
- src/graphql/execution/types.py:669:62: error[invalid-argument-type] Argument to bound method `get` is incorrect: Expected `Never`, found `Literal["errors"]`
- Found 638 diagnostics
+ Found 608 diagnostics

sockeye (https://github.com/awslabs/sockeye)
- sockeye/inference.py:410:32: error[invalid-argument-type] Argument is incorrect: Expected `RestrictLexicon | None`, found `object`
- Found 437 diagnostics
+ Found 436 diagnostics

porcupine (https://github.com/Akuli/porcupine)
- porcupine/plugins/filetypes.py:33:49: error[invalid-argument-type] Method `__getitem__` of type `bound method Top[dict[Unknown, Unknown]].__getitem__(key: Never, /) -> object` cannot be called with key of type `object` on object of type `Top[dict[Unknown, Unknown]]`
- porcupine/plugins/filetypes.py:33:70: error[invalid-argument-type] Method `__getitem__` of type `bound method Top[dict[Unknown, Unknown]].__getitem__(key: Never, /) -> object` cannot be called with key of type `object` on object of type `Top[dict[Unknown, Unknown]]`
- Found 25 diagnostics
+ Found 23 diagnostics

ignite (https://github.com/pytorch/ignite)
- tests/ignite/test_utils.py:49:28: error[invalid-argument-type] Method `__getitem__` of type `Overload[(index: int, /) -> Unknown, (index: slice[int | None, int | None, int | None], /) -> Sequence[Unknown]]` cannot be called with key of type `Literal["a"]` on object of type `Sequence[Unknown]`
- tests/ignite/test_utils.py:49:28: error[invalid-argument-type] Method `__getitem__` of type `bound method Top[dict[Unknown, Unknown]].__getitem__(key: Never, /) -> object` cannot be called with key of type `Literal["a"]` on object of type `Top[dict[Unknown, Unknown]]`
- tests/ignite/test_utils.py:50:28: error[invalid-argument-type] Method `__getitem__` of type `Overload[(index: int, /) -> Unknown, (index: slice[int | None, int | None, int | None], /) -> Sequence[Unknown]]` cannot be called with key of type `Literal["b"]` on object of type `Sequence[Unknown]`
- tests/ignite/test_utils.py:50:28: error[invalid-argument-type] Method `__getitem__` of type `bound method Top[dict[Unknown, Unknown]].__getitem__(key: Never, /) -> object` cannot be called with key of type `Literal["b"]` on object of type `Top[dict[Unknown, Unknown]]`
- Found 2223 diagnostics
+ Found 2219 diagnostics

PyGithub (https://github.com/PyGithub/PyGithub)
- github/AdvisoryCredit.py:97:31: error[invalid-argument-type] Method `__getitem__` of type `bound method Top[dict[Unknown, Unknown]].__getitem__(key: Never, /) -> object` cannot be called with key of type `Literal["login"]` on object of type `Top[dict[Unknown, Unknown]]`
- github/AdvisoryCredit.py:97:84: error[invalid-argument-type] Method `__getitem__` of type `bound method Top[dict[Unknown, Unknown]].__getitem__(key: Never, /) -> object` cannot be called with key of type `Literal["login"]` on object of type `Top[dict[Unknown, Unknown]]`
- github/AdvisoryCredit.py:98:31: error[invalid-argument-type] Method `__getitem__` of type `bound method Top[dict[Unknown, Unknown]].__getitem__(key: Never, /) -> object` cannot be called with key of type `Literal["type"]` on object of type `Top[dict[Unknown, Unknown]]`
- github/AdvisoryCredit.py:98:53: error[invalid-argument-type] Method `__getitem__` of type `bound method Top[dict[Unknown, Unknown]].__getitem__(key: Never, /) -> object` cannot be called with key of type `Literal["type"]` on object of type `Top[dict[Unknown, Unknown]]`
- github/AdvisoryCredit.py:109:31: error[invalid-argument-type] Method `__getitem__` of type `bound method Top[dict[Unknown, Unknown]].__getitem__(key: Never, /) -> object` cannot be called with key of type `Literal["login"]` on object of type `Top[dict[Unknown, Unknown]]`
- github/AdvisoryCredit.py:109:84: error[invalid-argument-type] Method `__getitem__` of type `bound method Top[dict[Unknown, Unknown]].__getitem__(key: Never, /) -> object` cannot be called with key of type `Literal["login"]` on object of type `Top[dict[Unknown, Unknown]]`
- github/AdvisoryCredit.py:110:21: error[invalid-argument-type] Method `__getitem__` of type `bound method Top[dict[Unknown, Unknown]].__getitem__(key: Never, /) -> object` cannot be called with key of type `Literal["login"]` on object of type `Top[dict[Unknown, Unknown]]`
- github/AdvisoryCredit.py:113:20: error[invalid-return-type] Return type does not match returned value: expected `SimpleCredit`, found `dict[str, object]`
- github/AdvisoryCredit.py:115:25: error[invalid-argument-type] Method `__getitem__` of type `bound method Top[dict[Unknown, Unknown]].__getitem__(key: Never, /) -> object` cannot be called with key of type `Literal["type"]` on object of type `Top[dict[Unknown, Unknown]]`
- github/AdvisoryCredit.py:115:25: error[invalid-argument-type] Invalid argument to key "type" with declared type `str` on TypedDict `SimpleCredit`: value of type `object`
- github/AdvisoryVulnerability.py:129:59: error[invalid-argument-type] Method `__getitem__` of type `bound method Top[dict[Unknown, Unknown]].__getitem__(key: Never, /) -> object` cannot be called with key of type `Literal["package"]` on object of type `Top[dict[Unknown, Unknown]]`
- github/AdvisoryVulnerability.py:129:59: error[invalid-assignment] Object of type `object` is not assignable to `SimpleAdvisoryVulnerabilityPackage`
- github/AdvisoryVulnerability.py:136:31: error[invalid-argument-type] Method `__getitem__` of type `bound method Top[dict[Unknown, Unknown]].__getitem__(key: Never, /) -> object` cannot be called with key of type `Literal["patched_versions"]` on object of type `Top[dict[Unknown, Unknown]]`
- github/AdvisoryVulnerability.py:138:31: error[invalid-argument-type] Method `__getitem__` of type `bound method Top[dict[Unknown, Unknown]].__getitem__(key: Never, /) -> object` cannot be called with key of type `Literal["vulnerable_functions"]` on object of type `Top[dict[Unknown, Unknown]]`
- github/AdvisoryVulnerability.py:141:51: error[invalid-argument-type] Method `__getitem__` of type `bound method Top[dict[Unknown, Unknown]].__getitem__(key: Never, /) -> object` cannot be called with key of type `Literal["vulnerable_functions"]` on object of type `Top[dict[Unknown, Unknown]]`
- github/AdvisoryVulnerability.py:142:20: error[invalid-argument-type] Method `__getitem__` of type `bound method Top[dict[Unknown, Unknown]].__getitem__(key: Never, /) -> object` cannot be called with key of type `Literal["vulnerable_functions"]` on object of type `Top[dict[Unknown, Unknown]]`
- github/AdvisoryVulnerability.py:146:31: error[invalid-argument-type] Method `__getitem__` of type `bound method Top[dict[Unknown, Unknown]].__getitem__(key: Never, /) -> object` cannot be called with key of type `Literal["vulnerable_version_range"]` on object of type `Top[dict[Unknown, Unknown]]`
- github/AdvisoryVulnerability.py:158:73: error[invalid-argument-type] Method `__getitem__` of type `bound method Top[dict[Unknown, Unknown]].__getitem__(key: Never, /) -> object` cannot be called with key of type `Literal["package"]` on object of type `Top[dict[Unknown, Unknown]]`
- github/AdvisoryVulnerability.py:158:73: error[invalid-assignment] Object of type `object` is not assignable to `SimpleAdvisoryVulnerabilityPackage`
- github/AdvisoryVulnerability.py:159:20: error[invalid-return-type] Return type does not match returned value: expected `SimpleAdvisoryVulnerability`, found `dict[str, object]`
- github/AdvisoryVulnerability.py:164:37: error[invalid-argument-type] Method `__getitem__` of type `bound method Top[dict[Unknown, Unknown]].__getitem__(key: Never, /) -> object` cannot be called with key of type `Literal["patched_versions"]` on object of type `Top[dict[Unknown, Unknown]]`
- github/AdvisoryVulnerability.py:164:37: error[invalid-argument-type] Invalid argument to key "patched_versions" with declared type `str | None` on TypedDict `SimpleAdvisoryVulnerability`: value of type `object`
- github/AdvisoryVulnerability.py:165:41: error[invalid-argument-type] Method `__getitem__` of type `bound method Top[dict[Unknown, Unknown]].__getitem__(key: Never, /) -> object` cannot be called with key of type `Literal["vulnerable_functions"]` on object of type `Top[dict[Unknown, Unknown]]`
- github/AdvisoryVulnerability.py:165:41: error[invalid-argument-type] Invalid argument to key "vulnerable_functions" with declared type `list[str] | None` on TypedDict `SimpleAdvisoryVulnerability`: value of type `object`
- github/AdvisoryVulnerability.py:166:45: error[invalid-argument-type] Method `__getitem__` of type `bound method Top[dict[Unknown, Unknown]].__getitem__(key: Never, /) -> object` cannot be called with key of type `Literal["vulnerable_version_range"]` on object of type `Top[dict[Unknown, Unknown]]`
- github/AdvisoryVulnerability.py:166:45: error[invalid-argument-type] Invalid argument to key "vulnerable_version_range" with declared type `str | None` on TypedDict `SimpleAdvisoryVulnerability`: value of type `object`
- github/AdvisoryVulnerability.py:170:30: error[unresolved-attribute] Attribute `package` is not defined on `SimpleAdvisoryVulnerability & ~Top[dict[Unknown, Unknown]]` in union `(SimpleAdvisoryVulnerability & ~Top[dict[Unknown, Unknown]]) | (AdvisoryVulnerability & ~Top[dict[Unknown, Unknown]])`
- github/AdvisoryVulnerability.py:171:25: error[unresolved-attribute] Attribute `package` is not defined on `SimpleAdvisoryVulnerability & ~Top[dict[Unknown, Unknown]]` in union `(SimpleAdvisoryVulnerability & ~Top[dict[Unknown, Unknown]]) | (AdvisoryVulnerability & ~Top[dict[Unknown, Unknown]])`
- github/AdvisoryVulnerability.py:173:33: error[unresolved-attribute] Attribute `patched_versions` is not defined on `SimpleAdvisoryVulnerability & ~Top[dict[Unknown, Unknown]]` in union `(SimpleAdvisoryVulnerability & ~Top[dict[Unknown, Unknown]]) | (AdvisoryVulnerability & ~Top[dict[Unknown, Unknown]])`
- github/AdvisoryVulnerability.py:174:37: error[unresolved-attribute] Attribute `vulnerable_functions` is not defined on `SimpleAdvisoryVulnerability & ~Top[dict[Unknown, Unknown]]` in union `(SimpleAdvisoryVulnerability & ~Top[dict[Unknown, Unknown]]) | (AdvisoryVulnerability & ~Top[dict[Unknown, Unknown]])`
- github/AdvisoryVulnerability.py:175:41: error[unresolved-attribute] Attribute `vulnerable_version_range` is not defined on `SimpleAdvisoryVulnerability & ~Top[dict[Unknown, Unknown]]` in union `(SimpleAdvisoryVulnerability & ~Top[dict[Unknown, Unknown]]) | (AdvisoryVulnerability & ~Top[dict[Unknown, Unknown]])`
- Found 326 diagnostics
+ Found 295 diagnostics

pydantic (https://github.com/pydantic/pydantic)
- pydantic/_internal/_core_metadata.py:87:54: error[invalid-assignment] Invalid assignment to key "pydantic_js_extra" with declared type `dict[str, Divergent] | ((dict[str, Divergent], /) -> None) | ((dict[str, Divergent], type[Any], /) -> None)` on TypedDict `CoreMetadata`: value of type `dict[object, object]`
- pydantic/fields.py:1573:13: error[invalid-argument-type] Argument is incorrect: Expected `dict[str, Divergent] | ((dict[str, Divergent], /) -> None) | None`, found `dict[str, Divergent] | dict[Never, Never] | (((dict[str, Divergent], /) -> None) & ~Top[dict[Unknown, Unknown]]) | None`
+ pydantic/fields.py:1573:13: error[invalid-argument-type] Argument is incorrect: Expected `dict[str, Divergent] | ((dict[str, Divergent], /) -> None) | None`, found `dict[str, Divergent] | dict[Never, Never] | Top[TypedDict] | (((dict[str, Divergent], /) -> None) & ~Top[dict[Unknown, Unknown]] & ~Top[TypedDict]) | None`
- pydantic/json_schema.py:1696:13: error[no-matching-overload] No overload of bound method `update` matches arguments
- Found 3165 diagnostics
+ Found 3163 diagnostics

tornado (https://github.com/tornadoweb/tornado)
- tornado/gen.py:532:47: error[invalid-argument-type] Argument to function `__new__` is incorrect: Expected `Iterable[None | Awaitable[Unknown] | list[Awaitable[Unknown]] | dict[Any, Awaitable[Unknown]] | Future[Unknown]]`, found `dict_values[object, object] | (Sequence[None | Awaitable[Unknown] | list[Awaitable[Unknown]] | dict[Any, Awaitable[Unknown]] | Future[Unknown]] & ~Top[dict[Unknown, Unknown]]) | (Mapping[Any, None | Awaitable[Unknown] | list[Awaitable[Unknown]] | dict[Any, Awaitable[Unknown]] | Future[Unknown]] & ~Top[dict[Unknown, Unknown]])`
- Found 334 diagnostics
+ Found 333 diagnostics

urllib3 (https://github.com/urllib3/urllib3)
- src/urllib3/fields.py:281:24: error[invalid-assignment] Object of type `dict_items[object, object]` is not assignable to `Iterable[tuple[str, str | bytes | None]]`
- Found 276 diagnostics
+ Found 275 diagnostics

mitmproxy (https://github.com/mitmproxy/mitmproxy)
- mitmproxy/http.py:601:21: error[no-matching-overload] No overload of function `always_bytes` matches arguments
+ mitmproxy/http.py:1081:67: warning[unused-type-ignore-comment] Unused blanket `type: ignore` directive

schemathesis (https://github.com/schemathesis/schemathesis)
- src/schemathesis/config/_diff_base.py:44:39: error[invalid-argument-type] Method `__getitem__` of type `bound method Top[dict[Unknown, Unknown]].__getitem__(key: Never, /) -> object` cannot be called with key of type `object` on object of type `Top[dict[Unknown, Unknown]]`
- src/schemathesis/config/_diff_base.py:44:49: error[invalid-argument-type] Method `__getitem__` of type `bound method Top[dict[Unknown, Unknown]].__getitem__(key: Never, /) -> object` cannot be called with key of type `object` on object of type `Top[dict[Unknown, Unknown]]`
- src/schemathesis/config/_diff_base.py:64:33: error[invalid-argument-type] Argument to bound method `get` is incorrect: Expected `Never`, found `object`
- src/schemathesis/config/_error.py:130:18: error[no-matching-overload] No overload of bound method `get` matches arguments
- src/schemathesis/openapi/checks.py:151:31: error[invalid-argument-type] Argument to function `unbundle` is incorrect: Expected `dict[str, Any] | bool | list[dict[str, Any] | bool]`, found `dict[Unknown, Unknown] | (Unresolvable & Top[dict[Unknown, Unknown]]) | bool | dict[str, Any] | dict[object, object]`
+ src/schemathesis/openapi/checks.py:151:31: error[invalid-argument-type] Argument to function `unbundle` is incorrect: Expected `dict[str, Any] | bool | list[dict[str, Any] | bool]`, found `dict[Unknown, Unknown] | (Unresolvable & Top[dict[Unknown, Unknown]]) | bool | dict[str, Any] | dict[Unknown | str, Unknown]`
- src/schemathesis/openapi/checks.py:173:13: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `dict[str, Any] | bool`, found `dict[Unknown, Unknown] | (Unresolvable & Top[dict[Unknown, Unknown]]) | dict[str, Any] | dict[object, object]`
+ src/schemathesis/openapi/checks.py:173:13: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `dict[str, Any] | bool`, found `dict[Unknown, Unknown] | (Unresolvable & Top[dict[Unknown, Unknown]]) | dict[str, Any] | dict[Unknown | str, Unknown]`
- src/schemathesis/resources/repository.py:119:32: error[invalid-argument-type] Argument to bound method `append` is incorrect: Expected `dict[str, Any]`, found `Top[dict[Unknown, Unknown]]`
+ src/schemathesis/resources/repository.py:119:32: error[invalid-argument-type] Argument to bound method `append` is incorrect: Expected `dict[str, Any]`, found `Top[dict[Unknown, Unknown]] | Top[TypedDict]`
- src/schemathesis/specs/openapi/adapter/responses.py:378:16: error[invalid-return-type] Return type does not match returned value: expected `str | None`, found `object`
- src/schemathesis/specs/openapi/adapter/responses.py:398:16: error[invalid-return-type] Return type does not match returned value: expected `str | None`, found `object`
- src/schemathesis/specs/openapi/adapter/responses.py:411:16: error[invalid-return-type] Return type does not match returned value: expected `str | None`, found `object`
- src/schemathesis/specs/openapi/adapter/responses.py:421:12: error[invalid-return-type] Return type does not match returned value: expected `str | None`, found `object`
- src/schemathesis/specs/openapi/examples.py:603:70: error[unresolved-attribute] Object of type `object` has no attribute `lower`
- src/schemathesis/specs/openapi/examples.py:609:33: error[invalid-argument-type] Argument to function `_find_matching_in_responses` is incorrect: Expected `dict[str, Any]`, found `Top[dict[Unknown, Unknown]]`
+ src/schemathesis/specs/openapi/examples.py:609:33: error[invalid-argument-type] Argument to function `_find_matching_in_responses` is incorrect: Expected `dict[str, Any]`, found `Top[dict[Unknown, Unknown]] | Top[TypedDict]`
- src/schemathesis/specs/openapi/examples.py:616:50: error[invalid-argument-type] Argument to function `_find_matching_in_responses` is incorrect: Expected `dict[str, Any]`, found `Top[dict[Unknown, Unknown]]`
+ src/schemathesis/specs/openapi/examples.py:616:50: error[invalid-argument-type] Argument to function `_find_matching_in_responses` is incorrect: Expected `dict[str, Any]`, found `Top[dict[Unknown, Unknown]] | Top[TypedDict]`
- Found 343 diagnostics
+ Found 334 diagnostics

artigraph (https://github.com/artigraph/artigraph)
- src/arti/storage/_internal.py:146:9: error[invalid-assignment] Invalid subscript assignment with key of type `Unknown` and value of type `object` on object of type `dict[str, str]`
- Found 156 diagnostics
+ Found 155 diagnostics

schema_salad (https://github.com/common-workflow-language/schema_salad)
- schema_salad/avro/schema.py:801:52: error[invalid-argument-type] Argument to bound method `get` is incorrect: Expected `Never`, found `Literal["type"]`
- schema_salad/avro/schema.py:802:34: error[invalid-argument-type] Method `__getitem__` of type `bound method Top[dict[Unknown, Unknown]].__getitem__(key: Never, /) -> object` cannot be called with key of type `Literal["names"]` on object of type `Top[dict[Unknown, Unknown]]`
- schema_salad/avro/schema.py:802:34: error[invalid-argument-type] Argument to function `is_subtype` is incorrect: Expected `None | str | int | ... omitted 6 union elements`, found `object`
- schema_salad/avro/schema.py:803:42: error[invalid-argument-type] Argument to bound method `get` is incorrect: Expected `Never`, found `Literal["type"]`
- schema_salad/avro/schema.py:804:44: error[invalid-argument-type] Method `__getitem__` of type `bound method Top[dict[Unknown, Unknown]].__getitem__(key: Never, /) -> object` cannot be called with key of type `Literal["names"]` on object of type `Top[dict[Unknown, Unknown]]`
- schema_salad/avro/schema.py:804:44: error[invalid-argument-type] Argument to function `is_subtype` is incorrect: Expected `None | str | int | ... omitted 6 union elements`, found `object`
- schema_salad/avro/schema.py:806:33: error[invalid-argument-type] Method `__getitem__` of type `bound method Top[dict[Unknown, Unknown]].__getitem__(key: Never, /) -> object` cannot be called with key of type `Literal["extends"]` on object of type `Top[dict[Unknown, Unknown]]`
- schema_salad/avro/schema.py:806:64: error[invalid-argument-type] Argument to bound method `get` is incorrect: Expected `Never`, found `Literal["name"]`
- schema_salad/avro/schema.py:808:25: error[invalid-argument-type] Argument to bound method `get` is incorrect: Expected `Never`, found `Literal["type"]`
- schema_salad/avro/schema.py:808:56: error[invalid-argument-type] Argument to bound method `get` is incorrect: Expected `Never`, found `Literal["type"]`
- schema_salad/avro/schema.py:809:38: error[invalid-argument-type] Method `__getitem__` of type `bound method Top[dict[Unknown, Unknown]].__getitem__(key: Never, /) -> object` cannot be called with key of type `Literal["items"]` on object of type `Top[dict[Unknown, Unknown]]`
- schema_salad/avro/schema.py:809:38: error[invalid-argument-type] Argument to function `is_subtype` is incorrect: Expected `None | str | int | ... omitted 6 union elements`, found `object`
- schema_salad/avro/schema.py:809:57: error[invalid-argument-type] Method `__getitem__` of type `bound method Top[dict[Unknown, Unknown]].__getitem__(key: Never, /) -> object` cannot be called with key of type `Literal["items"]` on object of type `Top[dict[Unknown, Unknown]]`
- schema_salad/avro/schema.py:809:57: error[invalid-argument-type] Argument to function `is_subtype` is incorrect: Expected `None | str | int | ... omitted 6 union elements`, found `object`
- schema_salad/avro/schema.py:810:25: error[invalid-argument-type] Argument to bound method `get` is incorrect: Expected `Never`, found `Literal["type"]`
- schema_salad/avro/schema.py:810:54: error[invalid-argument-type] Argument to bound method `get` is incorrect: Expected `Never`, found `Literal["type"]`
- schema_salad/avro/schema.py:811:38: error[invalid-argument-type] Method `__getitem__` of type `bound method Top[dict[Unknown, Unknown]].__getitem__(key: Never, /) -> object` cannot be called with key of type `Literal["values"]` on object of type `Top[dict[Unknown, Unknown]]`
- schema_salad/avro/schema.py:811:38: error[invalid-argument-type] Argument to function `is_subtype` is incorrect: Expected `None | str | int | ... omitted 6 union elements`, found `object`
- schema_salad/avro/schema.py:811:58: error[invalid-argument-type] Method `__getitem__` of type `bound method Top[dict[Unknown, Unknown]].__getitem__(key: Never, /) -> object` cannot be called with key of type `Literal["values"]` on object of type `Top[dict[Unknown, Unknown]]`
- schema_salad/avro/schema.py:811:58: error[invalid-argument-type] Argument to function `is_subtype` is incorrect: Expected `None | str | int | ... omitted 6 union elements`, found `object`
- schema_salad/avro/schema.py:812:25: error[invalid-argument-type] Argument to bound method `get` is incorrect: Expected `Never`, found `Literal["type"]`
- schema_salad/avro/schema.py:812:55: error[invalid-argument-type] Argument to bound method `get` is incorrect: Expected `Never`, found `Literal["type"]`
- schema_salad/avro/schema.py:813:38: error[invalid-argument-type] Method `__getitem__` of type `bound method Top[dict[Unknown, Unknown]].__getitem__(key: Never, /) -> object` cannot be called with key of type `Literal["symbols"]` on object of type `Top[dict[Unknown, Unknown]]`
- schema_salad/avro/schema.py:813:38: error[invalid-argument-type] Argument to function `is_subtype` is incorrect: Expected `None | str | int | ... omitted 6 union elements`, found `object`
- schema_salad/avro/schema.py:813:59: error[invalid-argument-type] Method `__getitem__` of type `bound method Top[dict[Unknown, Unknown]].__getitem__(key: Never, /) -> object` cannot be called with key of type `Literal["symbols"]` on object of type `Top[dict[Unknown, Unknown]]`
- schema_salad/avro/schema.py:813:59: error[invalid-argument-type] Argument to function `is_subtype` is incorrect: Expected `None | str | int | ... omitted 6 union elements`, found `object`
- schema_salad/avro/schema.py:814:25: error[invalid-argument-type] Argument to bound method `get` is incorrect: Expected `Never`, found `Literal["type"]`
- schema_salad/avro/schema.py:814:57: error[invalid-argument-type] Argument to bound method `get` is incorrect: Expected `Never`, found `Literal["type"]`
- schema_salad/avro/schema.py:815:57: error[invalid-argument-type] Method `__getitem__` of type `bound method Top[dict[Unknown, Unknown]].__getitem__(key: Never, /) -> object` cannot be called with key of type `Literal["fields"]` on object of type `Top[dict[Unknown, Unknown]]`
- schema_salad/avro/schema.py:817:66: error[invalid-argument-type] Method `__getitem__` of type `bound method Top[dict[Unknown, Unknown]].__getitem__(key: Never, /) -> object` cannot be called with key of type `Literal["fields"]` on object of type `Top[dict[Unknown, Unknown]]`
- Found 370 diagnostics
+ Found 340 diagnostics

psycopg (https://github.com/psycopg/psycopg)
- psycopg/psycopg/errors.py:514:38: error[invalid-argument-type] Argument to bound method `get` is incorrect: Expected `Never`, found `DiagnosticField`
- Found 666 diagnostics
+ Found 665 diagnostics

mypy (https://github.com/python/mypy)
- mypy/server/astdiff.py:157:67: error[invalid-argument-type] Argument to function `compare_symbol_table_snapshots` is incorrect: Expected `dict[str, tuple[object, ...]]`, found `Top[dict[Unknown, Unknown]]`
+ mypy/server/astdiff.py:157:67: error[invalid-argument-type] Argument to function `compare_symbol_table_snapshots` is incorrect: Expected `dict[str, tuple[object, ...]]`, found `Top[dict[Unknown, Unknown]] | Top[TypedDict]`
- mypy/server/astdiff.py:157:78: error[invalid-argument-type] Argument to function `compare_symbol_table_snapshots` is incorrect: Expected `dict[str, tuple[object, ...]]`, found `Top[dict[Unknown, Unknown]]`
+ mypy/server/astdiff.py:157:78: error[invalid-argument-type] Argument to function `compare_symbol_table_snapshots` is incorrect: Expected `dict[str, tuple[object, ...]]`, found `Top[dict[Unknown, Unknown]] | Top[TypedDict]`
- mypy/test/test_diff_cache.py:125:42: error[unsupported-operator] Operator `in` is not supported between objects of type `Literal["/b."]` and `object`
- mypy/test/test_diff_cache.py:125:56: error[unresolved-attribute] Object of type `object` has no attribute `startswith`
- mypy/test/test_diff_cache.py:126:42: error[unsupported-operator] Operator `in` is not supported between objects of type `Literal["/c."]` and `object`
- mypy/test/test_diff_cache.py:126:56: error[unresolved-attribute] Object of type `object` has no attribute `startswith`
- mypy/test/test_diff_cache.py:127:42: error[unsupported-operator] Operator `in` is not supported between objects of type `Literal["/a."]` and `object`
- mypy/test/test_diff_cache.py:127:56: error[unresolved-attribute] Object of type `object` has no attribute `startswith`
- Found 1762 diagnostics
+ Found 1756 diagnostics

mongo-python-driver (https://github.com/mongodb/mongo-python-driver)
- pymongo/asynchronous/topology.py:857:46: error[invalid-argument-type] Argument to bound method `get` is incorrect: Expected `Never`, found `Literal["topologyVersion"]`
+ pymongo/asynchronous/topology.py:859:57: error[invalid-argument-type] Argument to function `_is_stale_error_topology_version` is incorrect: Expected `Mapping[str, Any] | None`, found `object`
- pymongo/collation.py:225:16: error[invalid-return-type] Return type does not match returned value: expected `dict[str, Any] | None`, found `Mapping[str, Any] & Top[dict[Unknown, Unknown]]`
+ pymongo/collation.py:225:16: error[invalid-return-type] Return type does not match returned value: expected `dict[str, Any] | None`, found `(Mapping[str, Any] & Top[dict[Unknown, Unknown]]) | (Mapping[str, Any] & Top[TypedDict])`
- pymongo/errors.py:106:43: error[invalid-argument-type] Argument to bound method `get` is incorrect: Expected `Never`, found `Literal["errorLabels"]`
- pymongo/message.py:1719:47: error[invalid-argument-type] Argument to function `_maybe_add_read_preference` is incorrect: Expected `MutableMapping[str, Any]`, found `(Unknown & Top[MutableMapping[Unknown, Unknown]]) | (Mapping[str, Any] & Top[MutableMapping[Unknown, Unknown]])`
+ pymongo/message.py:1719:47: error[invalid-argument-type] Argument to function `_maybe_add_read_preference` is incorrect: Expected `MutableMapping[str, Any]`, found `(Unknown & Top[MutableMapping[Unknown, Unknown]]) | (Mapping[str, Any] & Top[MutableMapping[Unknown, Unknown]]) | (Unknown & Top[TypedDict]) | (Mapping[str, Any] & Top[TypedDict])`
- pymongo/synchronous/topology.py:855:46: error[invalid-argument-type] Argument to bound method `get` is incorrect: Expected `Never`, found `Literal["topologyVersion"]`
+ pymongo/synchronous/topology.py:857:57: error[invalid-argument-type] Argument to function `_is_stale_error_topology_version` is incorrect: Expected `Mapping[str, Any] | None`, found `object`
- Found 429 diagnostics
+ Found 428 diagnostics

pyproject-metadata (https://github.com/pypa/pyproject-metadata)
- pyproject_metadata/project_table.py:276:16: error[no-matching-overload] No overload of bound method `fullmatch` matches arguments
- pyproject_metadata/project_table.py:311:21: error[invalid-argument-type] Method `__getitem__` of type `bound method Top[dict[Unknown, Unknown]].__getitem__(key: Never, /) -> object` cannot be called with key of type `str` on object of type `Top[dict[Unknown, Unknown]]`
- pyproject_metadata/project_table.py:358:51: error[invalid-argument-type] Argument to function `join` is incorrect: Expected `str`, found `object`
- pyproject_metadata/pyproject.py:90:12: error[invalid-return-type] Return type does not match returned value: expected `dict[str, str] | None`, found `Top[dict[Unknown, Unknown]]`
+ pyproject_metadata/pyproject.py:90:12: error[invalid-return-type] Return type does not match returned value: expected `dict[str, str] | None`, found `Top[dict[Unknown, Unknown]] | Top[TypedDict]`
- Found 10 diagnostics
+ Found 7 diagnostics

apprise (https://github.com/caronc/apprise)
- apprise/config/base.py:1116:31: error[no-matching-overload] No overload of bound method `match` matches arguments
- apprise/config/base.py:1170:37: error[invalid-argument-type] Method `__delitem__` of type `bound method Top[dict[Unknown, Unknown]].__delitem__(key: Never, /) -> None` cannot be called with key of type `Literal["schema"]` on object of type `Top[dict[Unknown, Unknown]]`
- apprise/config/base.py:1175:45: error[invalid-argument-type] Argument to function `_special_token_handler` is incorrect: Expected `dict[str, object]`, found `Top[dict[Unknown, Unknown]]`
- apprise/config/base.py:1179:29: error[no-matching-overload] No overload of bound method `update` matches arguments
- apprise/config/base.py:1188:37: error[invalid-argument-type] Argument to function `_special_token_handler` is incorrect: Expected `dict[str, object]`, found `Top[dict[Unknown, Unknown]]`
- apprise/config/base.py:1196:21: error[no-matching-overload] No overload of bound method `update` matches arguments
- Found 3575 diagnostics
+ Found 3569 diagnostics

meson (https://github.com/mesonbuild/meson)
- mesonbuild/build.py:436:24: error[invalid-return-type] Return type does not match returned value: expected `_T@copy_value`, found `list[Never] | dict[Never, Never] | set[Never]`
+ mesonbuild/build.py:436:24: error[invalid-return-type] Return type does not match returned value: expected `_T@copy_value`, found `list[Never] | dict[Never, Never] | Top[TypedDict] | set[Never]`
- mesonbuild/cargo/manifest.py:117:36: error[no-matching-overload] No overload of bound method `get` matches arguments
- mesonbuild/interpreter/type_checking.py:252:37: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `dict[str, str | list[str]] | None`, found `dict[object, str | list[str]]`
- mesonbuild/interpreterbase/_unholder.py:18:16: error[invalid-return-type] Return type does not match returned value: expected `Sequence[Divergent] | int | dict[str, Divergent] | ... omitted 5 union elements`, found `HoldableObject | int | str | Top[list[Unknown]] | Top[dict[Unknown, Unknown]]`
+ mesonbuild/interpreterbase/_unholder.py:18:16: error[invalid-return-type] Return type does not match returned value: expected `Sequence[Divergent] | int | dict[str, Divergent] | ... omitted 5 union elements`, found `HoldableObject | int | str | ... omitted 3 union elements`
- mesonbuild/interpreterbase/helpers.py:39:20: error[invalid-return-type] Return type does not match returned value: expected `Sequence[Divergent] | int | dict[str, Divergent] | ... omitted 5 union elements`, found `dict[object, Sequence[Divergent] | int | dict[str, Divergent] | ... omitted 5 union elements]`
- mesonbuild/interpreterbase/helpers.py:39:33: error[invalid-argument-type] Argument to function `resolver` is incorrect: Expected `Sequence[Divergent] | int | dict[str, Divergent] | ... omitted 5 union elements`, found `object`
- mesonbuild/interpreterbase/helpers.py:60:54: error[invalid-argument-type] Argument to function `stringifyUserArguments` is incorrect: Expected `Sequence[Divergent] | int | dict[str, Divergent] | ... omitted 5 union elements`, found `object`
- mesonbuild/interpreterbase/helpers.py:61:54: error[invalid-argument-type] Argument to function `stringifyUserArguments` is incorrect: Expected `Sequence[Divergent] | int | dict[str, Divergent] | ... omitted 5 union elements`, found `object`
- mesonbuild/interpreterbase/interpreterbase.py:615:13: error[invalid-assignment] Invalid subscript assignment with key of type `object` and value of type `InterpreterObject` on object of type `dict[str, InterpreterObject | None]`
- mesonbuild/interpreterbase/interpreterbase.py:615:41: error[invalid-argument-type] Argument to bound method `_holderify` is incorrect: Expected `Sequence[Divergent] | int | dict[str, Divergent] | ... omitted 5 union elements`, found `object`
- Found 2354 diagnostics
+ Found 2346 diagnostics

vision (https://github.com/pytorch/vision)
- torchvision/transforms/v2/_utils.py:45:29: error[invalid-argument-type] Argument to function `_check_fill_arg` is incorrect: Expected `int | float | Sequence[int | float] | None | dict[type | str, int | float | Sequence[int | float] | None]`, found `object`
- torchvision/transforms/v2/_utils.py:69:13: error[invalid-assignment] Invalid subscript assignment with key of type `object` and value of type `list[int | float] | None` on object of type `dict[type | str, int | float | Sequence[int | float] | None]`
- torchvision/transforms/v2/_utils.py:69:41: error[invalid-argument-type] Argument to function `_convert_fill_arg` is incorrect: Expected `int | float | Sequence[int | float] | None`, found `object`
- Found 1414 diagnostics
+ Found 1411 diagnostics

cloud-init (https://github.com/canonical/cloud-init)
- cloudinit/config/cc_ubuntu_pro.py:129:16: error[no-matching-overload] No overload of function `search` matches arguments
- cloudinit/config/cc_ubuntu_pro.py:130:48: error[invalid-argument-type] Argument to function `escape` is incorrect: Argument type `~None` does not satisfy constraints (`str`, `bytes`) of type variable `AnyStr`
- cloudinit/config/cc_ubuntu_pro.py:136:23: error[invalid-argument-type] Argument to function `subp` is incorrect: Expected `str | bytes | list[str] | list[bytes]`, found `list[object] | list[str]`
- cloudinit/config/cc_ubuntu_pro.py:140:27: error[no-matching-overload] No overload of bound method `replace` matches arguments
- Found 1318 diagnostics
+ Found 1314 diagnostics

mkdocs (https://github.com/mkdocs/mkdocs)
+ mkdocs/config/config_options.py:139:56: error[invalid-argument-type] Argument to bound method `setdefault` is incorrect: Expected `Never`, found `str`
+ mkdocs/config/config_options.py:142:33: error[no-matching-overload] No overload of bound method `setdefault` matches arguments
- mkdocs/config/config_options.py:274:20: error[invalid-return-type] Return type does not match returned value: expected `dict[str, T@DictOfItems]`, found `Top[dict[Unknown, Unknown]] & ~AlwaysTruthy`
+ mkdocs/config/config_options.py:274:20: error[invalid-return-type] Return type does not match returned value: expected `dict[str, T@DictOfItems]`, found `(Top[dict[Unknown, Unknown]] & ~AlwaysTruthy) | (Top[TypedDict] & ~AlwaysTruthy)`
+ mkdocs/config/config_options.py:283:9: error[invalid-assignment] Object of type `(Top[dict[Unknown, Unknown]] & ~AlwaysFalsy) | (Top[TypedDict] & ~AlwaysFalsy)` is not assignable to attribute `data` of type `dict[Unknown, Unknown]`
- mkdocs/config/config_options.py:298:16: error[invalid-return-type] Return type does not match returned value: expected `dict[str, T@DictOfItems]`, found `Top[dict[Unknown, Unknown]] & ~AlwaysFalsy`
+ mkdocs/config/config_options.py:298:16: error[invalid-return-type] Return type does not match returned value: expected `dict[str, T@DictOfItems]`, found `(Top[dict[Unknown, Unknown]] & ~AlwaysFalsy) | (Top[TypedDict] & ~AlwaysFalsy)`
- mkdocs/config/config_options.py:834:12: error[invalid-argument-type] Method `__getitem__` of type `bound method Top[dict[Unknown, Unknown]].__getitem__(key: Never, /) -> object` cannot be called with key of type `Literal["name"]` on object of type `Top[dict[Unknown, Unknown]]`
- mkdocs/config/config_options.py:834:49: error[invalid-argument-type] Method `__getitem__` of type `bound method Top[dict[Unknown, Unknown]].__getitem__(key: Never, /) -> object` cannot be called with key of type `Literal["name"]` on object of type `Top[dict[Unknown, Unknown]]`
- mkdocs/config/config_options.py:836:46: error[invalid-argument-type] Method `__getitem__` of type `bound method Top[dict[Unknown, Unknown]].__getitem__(key: Never, /) -> object` cannot be called with key of type `Literal["name"]` on object of type `Top[dict[Unknown, Unknown]]`
- mkdocs/config/config_options.py:840:16: error[invalid-argument-type] Method `__getitem__` of type `bound method Top[dict[Unknown, Unknown]].__getitem__(key: Never, /) -> object` cannot be called with key of type `Literal["name"]` on object of type `Top[dict[Unknown, Unknown]]`
- mkdocs/config/config_options.py:844:63: error[invalid-argument-type] Method `__getitem__` of type `bound method Top[dict[Unknown, Unknown]].__getitem__(key: Never, /) -> object` cannot be called with key of type `Literal["custom_dir"]` on object of type `Top[dict[Unknown, Unknown]]`
+ mkdocs/config/config_options.py:846:13: error[invalid-assignment] Cannot assign to a subscript on an object of type `Top[TypedDict]`
- mkdocs/config/config_options.py:846:67: error[invalid-argument-type] Method `__getitem__` of type `bound method Top[dict[Unknown, Unknown]].__getitem__(key: Never, /) -> object` cannot be called with key of type `Literal["custom_dir"]` on object of type `Top[dict[Unknown, Unknown]]`
- mkdocs/config/config_options.py:848:63: error[invalid-argument-type] Method `__getitem__` of type `bound method Top[dict[Unknown, Unknown]].__getitem__(key: Never, /) -> object` cannot be called with key of type `Literal["custom_dir"]` on object of type `Top[dict[Unknown, Unknown]]`
- mkdocs/config/config_options.py:851:26: error[invalid-argument-type] Method `__getitem__` of type `bound method Top[dict[Unknown, Unknown]].__getitem__(key: Never, /) -> object` cannot be called with key of type `Literal["custom_dir"]` on object of type `Top[dict[Unknown, Unknown]]`
- mkdocs/config/config_options.py:855:56: error[invalid-argument-type] Method `__getitem__` of type `bound method Top[dict[Unknown, Unknown]].__getitem__(key: Never, /) -> object` cannot be called with key of type `Literal["locale"]` on object of type `Top[dict[Unknown, Unknown]]`
- mkdocs/config/config_options.py:858:28: error[invalid-argument-type] Argument expression after ** must be a mapping with `str` key type: Found `object`
+ mkdocs/config/config_options.py:985:9: error[invalid-assignment] Invalid subscript assignment with key of type `str` and value of type `(Top[dict[Unknown, Unknown]] & ~AlwaysFalsy) | (Top[TypedDict] & ~AlwaysFalsy)` on object of type `dict[str, dict[Unknown, Unknown]]`
+ mkdocs/config/config_options.py:1007:32: error[unresolved-attribute] Attribute `popitem` is not defined on `Top[TypedDict]` in union `Top[dict[Unknown, Unknown]] | Top[TypedDict]`
+ mkdocs/config/config_options.py:1064:46: error[invalid-argument-type] Argument to bound method `_parse_configs` is incorrect: Expected `list[Unknown] | tuple[Unknown, ...] | dict[Unknown, Unknown]`, found `Top[list[Unknown]] | tuple[object, ...] | Top[dict[Unknown, Unknown]] | Top[TypedDict]`
- mkdocs/tests/structure/page_tests.py:715:17: error[invalid-assignment] Object of type `str | None` is not assignable to attribute `edit_uri` of type `weak_property`
+ mkdocs/tests/structure/page_tests.py:715:17: error[invalid-assignment] Object of type `str | None | Unknown` is not assignable to attribute `edit_uri` of type `weak_property`
- Found 220 diagnostics
+ Found 217 diagnostics

openlibrary (https://github.com/internetarchive/openlibrary)
+ openlibrary/core/lists/model.py:475:29: warning[redundant-cast] Value is already of type `ThingReferenceDict`
- openlibrary/core/lists/model.py:435:24: error[unresolved-attribute] Attribute `key` is not defined on `AnnotatedSeed & ~Top[dict[Unknown, Unknown]]` in union `(Thing & ~str & ~Top[dict[Unknown, Unknown]]) | (AnnotatedSeed & ~Top[dict[Unknown, Unknown]])`
- openlibrary/core/lists/model.py:436:13: error[invalid-assignment] Object of type `(Thing & ~str & ~Top[dict[Unknown, Unknown]]) | (AnnotatedSeed & ~Top[dict[Unknown, Unknown]])` is not assignable to attribute `value` of type `Thing | str`
- openlibrary/core/lists/model.py:483:27: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `Thing | str | AnnotatedSeed`, found `str | (ThingReferenceDict & ~Top[dict[Unknown, Unknown]]) | (AnnotatedSeedDict & ~Top[dict[Unknown, Unknown]])`
- openlibrary/plugins/upstream/utils.py:369:49: error[no-matching-overload] No overload of function `sorted` matches arguments
- Found 1133 diagnostics
+ Found 1130 diagnostics

strawberry (https://github.com/strawberry-graphql/strawberry)
+ strawberry/subscriptions/protocols/graphql_transport_ws/handlers.py:180:13: error[invalid-assignment] Cannot assign to a subscript on an object of type `Context@BaseGraphQLTransportWSHandler`
- strawberry/subscriptions/protocols/graphql_transport_ws/handlers.py:182:13: error[invalid-assignment] Object of type `dict[str, object] | dict[Unknown, Unknown]` is not assignable to attribute `connection_params` on type `(Unknown & <Protocol with members 'connection_params'> & ~Top[dict[Unknown, Unknown]]) | (Context@BaseGraphQLTransportWSHandler & <Protocol with members 'connection_params'> & ~Top[dict[Unknown, Unknown]])`
+ strawberry/subscriptions/protocols/graphql_transport_ws/handlers.py:182:13: error[invalid-assignment] Object of type `dict[str, object]` is not assignable to attribute `connection_params` on type `(Unknown & <Protocol with members 'connection_params'> & ~Top[dict[Unknown, Unknown]]) | (Context@BaseGraphQLTransportWSHandler & <Protocol with members 'connection_params'> & ~Top[dict[Unknown, Unknown]])`
+ strawberry/subscriptions/protocols/graphql_ws/handlers.py:101:13: error[invalid-assignment] Cannot assign to a subscript on an object of type `Context@BaseGraphQLWSHandler`
- Found 343 diagnostics
+ Found 345 diagnostics

setuptools (https://github.com/pypa/setuptools)
- setuptools/_distutils/command/build_ext.py:418:39: error[invalid-argument-type] Method `__getitem__` of type `bound method Top[dict[Unknown, Unknown]].__getitem__(key: Never, /) -> object` cannot be called with key of type `Literal["sources"]` on object of type `Top[dict[Unknown, Unknown]]`
+ setuptools/_distutils/command/build_ext.py:445:30: error[not-iterable] Object of type `~AlwaysFalsy` is not iterable
- setuptools/_distutils/command/build_ext.py:430:38: error[invalid-argument-type] Argument to bound method `get` is incorrect: Expected `Never`, found `Literal["include_dirs", "library_dirs", "libraries", "extra_objects", "extra_compile_args", "extra_link_args"]`
- setuptools/_distutils/command/build_ext.py:435:55: error[invalid-argument-type] Argument to bound method `get` is incorrect: Expected `Never`, found `Literal["rpath"]`
- setuptools/_distutils/command/build_ext.py:441:37: error[invalid-argument-type] Argument to bound method `get` is incorrect: Expected `Never`, found `Literal["macros"]`
- Found 1125 diagnostics
+ Found 1122 diagnostics

xarray-dataclasses (https://github.com/astropenguin/xarray-dataclasses)
- xarray_dataclasses/dataarray.py:187:27: error[invalid-argument-type] Method `__getitem__` of type `Overload[(index: int, /) -> int, (index: slice[int | None, int | None, int | None], /) -> Sequence[int]]` cannot be called with key of type `str` on object of type `Sequence[int]`
- xarray_dataclasses/dataarray.py:187:27: error[invalid-argument-type] Method `__getitem__` of type `bound method Top[dict[Unknown, Unknown]].__getitem__(key: Never, /) -> object` cannot be called with key of type `str` on object of type `Top[dict[Unknown, Unknown]]`
- Found 13 diagnostics
+ Found 11 diagnostics

cwltool (https://github.com/common-workflow-language/cwltool)
- cwltool/job.py:180:46: error[no-matching-overload] No overload of bound method `get` matches arguments
- cwltool/job.py:181:39: error[no-matching-overload] No overload of bound method `get` matches arguments
- cwltool/main.py:1337:58: error[invalid-argument-type] Argument to function `remove_at_id` is incorrect: Expected `MutableMapping[str, None | int | str | ... omitted 3 union elements]`, found `Top[MutableMapping[Unknown, Unknown]]`
+ cwltool/main.py:1337:58: error[invalid-argument-type] Argument to function `remove_at_id` is incorrect: Expected `MutableMapping[str, None | int | str | ... omitted 3 union elements]`, found `Top[MutableMapping[Unknown, Unknown]] | Top[TypedDict]`
- cwltool/process.py:314:24: error[invalid-argument-type] Argument to bound method `get` is incorrect: Expected `Never`, found `Literal["class"]`
- cwltool/process.py:318:51: error[invalid-argument-type] Argument to function `_collectDirEntries` is incorrect: Expected `MutableMapping[str, None | int | str | ... omitted 3 union elements] | MutableSequence[MutableMapping[str, None | int | str | ... omitted 3 union elements]] | None`, found `object`
- tests/test_examples.py:327:12: error[invalid-argument-type] Method `__getitem__` of type `bound method MutableMapping[str, Divergent].__getitem__(key: str, /) -> Divergent` cannot be called with key of type `Literal[0]` on object of type `MutableMapping[str, Divergent]`
- tests/test_examples.py:327:12: error[invalid-argument-type] Method `__getitem__` of type `Overload[(key: SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> LiteralString, (key: SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> str]` cannot be called with key of type `Literal["checksum"]` on object of type `str`
- tests/test_examples.py:327:12: error[not-subscriptable] Cannot subscript object of type `None` with no `__getitem__` method
- tests/test_examples.py:327:12: error[not-subscriptable] Cannot subscript object of type `int` with no `__getitem__` method
- tests/test_examples.py:327:12: error[not-subscriptable] Cannot subscript object of type `float` with no `__getitem__` method
- tests/test_examples.py:328:12: error[invalid-argument-type] Method `__getitem__` of type `bound method MutableMapping[str, Divergent].__getitem__(key: str, /) -> Divergent` cannot be called with key of type `Literal[1]` on object of type `MutableMapping[str, Divergent]`
- tests/test_examples.py:328:12: error[not-subscriptable] Cannot subscript object of type `None` with no `__getitem__` method
- tests/test_examples.py:328:12: error[not-subscriptable] Cannot subscript object of type `int` with no `__getitem__` method
- tests/test_examples.py:328:12: error[not-subscriptable] Cannot subscript object of type `float` with no `__getitem__` method
- tests/test_examples.py:329:12: error[invalid-argument-type] Method `__getitem__` of type `bound method MutableMapping[str, Divergent].__getitem__(key: str, /) -> Divergent` cannot be called with key of type `Literal[2]` on object of type `MutableMapping[str, Divergent]`
- tests/test_examples.py:329:12: error[invalid-argument-type] Method `__getitem__` of type `Overload[(key: SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> LiteralString, (key: SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> str]` cannot be called with key of type `Literal["checksum"]` on object of type `str`
- tests/test_examples.py:329:12: error[not-subscriptable] Cannot subscript object of type `None` with no `__getitem__` method
- tests/test_examples.py:329:12: error[not-subscriptable] Cannot subscript object of type `int` with no `__getitem__` method
- tests/test_examples.py:329:12: error[not-subscriptable] Cannot subscript object of type `float` with no `__getitem__` method
- tests/test_examples.py:342:12: error[invalid-argument-type] Method `__getitem__` of type `Overload[(key: SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> LiteralString, (key: SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> str]` cannot be called with key of type `Literal["checksum"]` on object of type `str`
- tests/test_examples.py:342:12: error[invalid-argument-type] Method `__getitem__` of type `Overload[(index: int, /) -> Divergent, (index: slice[int | None, int | None, int | None], /) -> MutableSequence[Divergent]]` cannot be called with key of type `Literal["checksum"]` on object of type `MutableSequence[Divergent]`
- tests/test_examples.py:342:12: error[not-subscriptable] Cannot subscript object of type `None` with no `__getitem__` method
- tests/test_examples.py:342:12: error[not-subscriptable] Cannot subscript object of type `int` with no `__getitem__` method
- tests/test_examples.py:342:12: error[not-subscriptable] Cannot subscript object of type `float` with no `__getitem__` method
- tests/test_examples.py:1448:12: error[invalid-argument-type] Method `__getitem__` of type `Overload[(index: int, /) -> Divergent, (index: slice[int | None, int | None, int | None], /) -> MutableSequence[Divergent]]` cannot be called with key of type `Literal["checksum"]` on object of type `MutableSequence[Divergent]`
- tests/test_examples.py:1448:12: error[invalid-argument-type] Method `__getitem__` of type `bound method Top[dict[Unknown, Unknown]].__getitem__(key: Never, /) -> object` cannot be called with key of type `Literal["checksum"]` on object of type `Top[dict[Unknown, Unknown]]`
- tests/test_examples.py:1693:28: error[invalid-argument-type] Method `__getitem__` of type `Overload[(key: SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> LiteralString, (key: SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> str]` cannot be called with key of type `Literal["location"]` on object of type `str`
- tests/test_examples.py:1693:63: error[not-iterable] Object of type `None | int | str | ... omitted 3 union elements` may not be iterable
- tests/test_secrets.py:31:41: error[invalid-argument-type] Method `__getitem__` of type `Overload[(index: int, /) -> Divergent, (index: slice[int | None, int | None, int | None], /) -> MutableSequence[Divergent]]` cannot be called with key of type `Literal["foo"]` on object of type `MutableSequence[Divergent]`
- tests/test_secrets.py:31:41: error[invalid-argument-type] Method `__getitem__` of type `bound method Top[dict[Unknown, Unknown]].__getitem__(key: Never, /) -> object` cannot be called with key of type `Literal["foo"]` on object of type `Top[dict[Unknown, Unknown]]`
- Found 502 diagnostics
+ Found 473 diagnostics

hydra-zen (https://github.com/mit-ll-responsible-ai/hydra-zen)
+ src/hydra_zen/structured_configs/_implementations.py:3837:9: error[invalid-assignment] Object of type `(Sequence[Divergent] & Top[dict[Unknown, Unknown]]) | (ListConfig & Top[dict[Unknown, Unknown]]) | (DictConfig & Top[dict[Unknown, Unknown]]) | ... omitted 4 union elements` is not assignable to attribute `dict_` of type `dict[Any, Any]`
- Found 514 diagnostics
+ Found 515 diagnostics

xarray (https://github.com/pydata/xarray)
- xarray/core/dataarray.py:473:9: error[invalid-assignment] Object of type `(Sequence[Sequence[Unknown] | Index[Any] | DataArray | Variable | ndarray[tuple[Any, ...], dtype[Any]]] & Top[dict[Unknown, Unknown]]) | (Mapping[Unknown, Unknown] & Top[dict[Unknown, Unknown]]) | dict[Unknown, Variable]` is not assignable to attribute `_coords` of type `dict[Any, Variable]`
+ xarray/core/dataarray.py:473:9: error[invalid-assignment] Object of type `(Sequence[Sequence[Unknown] | Index[Any] | DataArray | Variable | ndarray[tuple[Any, ...], dtype[Any]]] & Top[dict[Unknown, Unknown]]) | (Mapping[Unknown, Unknown] & Top[dict[Unknown, Unknown]]) | (Mapping[Unknown, Unknown] & Top[TypedDict]) | dict[Unknown, Variable]` is not assignable to attribute `_coords` of type `dict[Any, Variable]`

scikit-build-core (https://github.com/scikit-build/scikit-build-core)
- src/scikit_build_core/_vendor/pyproject_metadata/project_table.py:276:16: error[no-matching-overload] No overload of bound method `fullmatch` matches arguments
- src/scikit_build_core/_vendor/pyproject_metadata/project_table.py:311:21: error[invalid-argument-type] Method `__getitem__` of type `bound method Top[dict[Unknown, Unknown]].__getitem__(key: Never, /) -> object` cannot be called with key of type `str` on object of type `Top[dict[Unknown, Unknown]]`
- src/scikit_build_core/_vendor/pyproject_metadata/project_table.py:358:51: error[invalid-argument-type] Argument to function `join` is incorrect: Expected `str`, found `object`
- src/scikit_build_core/_vendor/pyproject_metadata/pyproject.py:90:12: error[invalid-return-type] Return type does not match returned value: expected `dict[str, str] | None`, found `Top[dict[Unknown, Unknown]]`
+ src/scikit_build_core/_vendor/pyproject_metadata/pyproject.py:90:12: error[invalid-return-type] Return type does not match returned value: expected `dict[str, str] | None`, found `Top[dict[Unknown, Unknown]] | Top[TypedDict]`
- Found 57 diagnostics
+ Found 54 diagnostics

altair (https://github.com/vega/altair)
- altair/jupyter/jupyter_chart.py:251:34: error[unresolved-attribute] Attribute `to_dict` is not defined on `UndefinedType & ~Top[dict[Unknown, Unknown]]` in union `(Any & ~Top[dict[Unknown, Unknown]]) | (UndefinedType & ~Top[dict[Unknown, Unknown]])`
+ altair/jupyter/jupyter_chart.py:251:34: error[unresolved-attribute] Attribute `to_dict` is not defined on `UndefinedType & ~Top[dict[Unknown, Unknown]]` in union `(Any & ~Top[dict[Unknown, Unknown]] & ~Top[TypedDict]) | (UndefinedType & ~Top[dict[Unknown, Unknown]])`
- altair/jupyter/jupyter_chart.py:253:35: error[invalid-argument-type] Method `__getitem__` of type `bound method Top[dict[Unknown, Unknown]].__getitem__(key: Never, /) -> object` cannot be called with key of type `Literal["type"]` on object of type `Top[dict[Unknown, Unknown]]`
- altair/jupyter/jupyter_chart.py:256:29: error[no-matching-overload] No overload of bou

... (truncated 247 lines) ...

@astral-sh-bot
Copy link
Copy Markdown

astral-sh-bot bot commented Mar 13, 2026

Memory usage report

Summary

Project Old New Diff Outcome
prefect 713.23MB 713.80MB +0.08% (590.52kB)
sphinx 264.74MB 264.91MB +0.06% (175.76kB)
trio 117.65MB 117.68MB +0.02% (21.32kB)
flake8 47.93MB 47.93MB +0.00% (1.90kB)

Significant changes

Click to expand detailed breakdown

prefect

Name Old New Diff Outcome
infer_expression_types_impl 61.53MB 61.65MB +0.19% (119.12kB)
all_narrowing_constraints_for_expression 7.11MB 7.20MB +1.39% (100.88kB)
all_negative_narrowing_constraints_for_expression 2.61MB 2.68MB +2.45% (65.58kB)
infer_definition_types 89.43MB 89.49MB +0.07% (60.28kB)
infer_expression_type_impl 13.77MB 13.80MB +0.21% (29.52kB)
infer_scope_types_impl 53.90MB 53.93MB +0.05% (28.15kB)
Type<'db>::member_lookup_with_policy_ 16.14MB 16.17MB +0.14% (23.04kB)
is_redundant_with_impl::interned_arguments 5.42MB 5.44MB +0.37% (20.80kB)
is_redundant_with_impl 5.51MB 5.53MB +0.35% (19.96kB)
Type<'db>::apply_specialization_ 3.56MB 3.58MB +0.46% (16.69kB)
StaticClassLiteral<'db>::implicit_attribute_inner_ 9.90MB 9.92MB +0.16% (16.27kB)
Type<'db>::class_member_with_policy_ 17.68MB 17.69MB +0.08% (15.31kB)
Type<'db>::apply_specialization_::interned_arguments 2.86MB 2.87MB +0.38% (11.02kB)
check_file_impl 17.90MB 17.89MB -0.06% (10.52kB)
infer_unpack_types 883.14kB 892.23kB +1.03% (9.09kB)
... 48 more

sphinx

Name Old New Diff Outcome
all_narrowing_constraints_for_expression 2.34MB 2.37MB +1.42% (33.93kB)
all_negative_narrowing_constraints_for_expression 1.00MB 1.03MB +2.56% (26.25kB)
infer_expression_types_impl 21.47MB 21.50MB +0.10% (21.53kB)
is_redundant_with_impl 1.78MB 1.79MB +0.71% (13.01kB)
is_redundant_with_impl::interned_arguments 2.02MB 2.03MB +0.57% (11.77kB)
infer_definition_types 23.97MB 23.98MB +0.03% (8.05kB)
Type<'db>::member_lookup_with_policy_ 6.51MB 6.52MB +0.10% (6.70kB)
Type<'db>::try_call_dunder_get_ 4.96MB 4.96MB +0.10% (5.19kB)
IntersectionType 880.95kB 885.92kB +0.56% (4.98kB)
Type<'db>::class_member_with_policy_ 7.63MB 7.64MB +0.06% (4.83kB)
Type<'db>::apply_specialization_ 1.64MB 1.64MB +0.28% (4.64kB)
infer_scope_types_impl 15.50MB 15.50MB +0.03% (4.09kB)
UnionType 1.24MB 1.24MB +0.27% (3.38kB)
FunctionType 3.10MB 3.11MB +0.09% (2.91kB)
Type<'db>::apply_specialization_::interned_arguments 1.45MB 1.45MB +0.18% (2.73kB)
... 43 more

trio

Name Old New Diff Outcome
all_narrowing_constraints_for_expression 589.09kB 599.57kB +1.78% (10.49kB)
all_negative_narrowing_constraints_for_expression 183.22kB 188.31kB +2.78% (5.09kB)
infer_expression_types_impl 7.07MB 7.07MB +0.02% (1.25kB)
infer_expression_type_impl 1.32MB 1.32MB +0.08% (1.07kB)
infer_definition_types 7.72MB 7.73MB +0.01% (1.01kB)
is_redundant_with_impl 473.21kB 473.94kB +0.15% (744.00B)
is_redundant_with_impl::interned_arguments 537.45kB 538.14kB +0.13% (704.00B)
IntersectionType 222.50kB 222.86kB +0.16% (368.00B)
UnionType 304.73kB 305.06kB +0.11% (336.00B)
known_class_to_class_literal 6.08kB 6.22kB +2.25% (140.00B)
loop_header_reachability 133.07kB 133.16kB +0.06% (84.00B)
KnownClassArgument 2.30kB 2.35kB +2.38% (56.00B)
infer_scope_types_impl 4.78MB 4.78MB +0.00% (48.00B)

flake8

Name Old New Diff Outcome
all_narrowing_constraints_for_expression 82.01kB 83.16kB +1.40% (1.15kB)
all_negative_narrowing_constraints_for_expression 39.60kB 40.34kB +1.86% (756.00B)
infer_definition_types 1.87MB 1.87MB +0.00% (12.00B)

Copy link
Copy Markdown
Member

@AlexWaygood AlexWaygood left a comment

Choose a reason for hiding this comment

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

Exciting! 😃

I know this is still in draft, just a couple of things I noticed

Comment on lines +158 to +162
if class.is_known(db, KnownClass::Dict) {
UnionType::from_two_elements(db, instance_constraint, Type::TypedDictTop)
} else {
instance_constraint
}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

you also want to do the same here if class.is_known(db, KnownClass::MutableMapping)

@charliermarsh charliermarsh force-pushed the charlie/td-narrow branch 2 times, most recently from 18db004 to 3baa343 Compare March 14, 2026 02:51
@codspeed-hq
Copy link
Copy Markdown

codspeed-hq bot commented Mar 14, 2026

Merging this PR will not alter performance

✅ 28 untouched benchmarks
⏩ 30 skipped benchmarks1


Comparing charlie/td-narrow (cbe8a82) with charlie/td-specialize-2 (4d81db0)

Open in CodSpeed

Footnotes

  1. 30 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@charliermarsh charliermarsh force-pushed the charlie/td-narrow branch 6 times, most recently from 0be1f1e to bb52eee Compare March 14, 2026 19:54
@charliermarsh
Copy link
Copy Markdown
Member Author

I think these changes have the behavior we want, but it's more complex than I wanted.

Copy link
Copy Markdown
Member

@AlexWaygood AlexWaygood left a comment

Choose a reason for hiding this comment

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

Haven't looked through the whole patch yet because it's in draft (LMK if you want me to) -- but there are more changes to narrow.rs now than I'd have expected

def f(x: dict[str, int] | list[str], y: object):
if isinstance(x, t.Dict):
reveal_type(x) # revealed: dict[str, int]
reveal_type(x) # revealed: (dict[str, int] & dict[Any, Any]) | (dict[str, int] & Top[TypedDict])
Copy link
Copy Markdown
Member

@AlexWaygood AlexWaygood Mar 15, 2026

Choose a reason for hiding this comment

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

this should still be dict[str, int], and this will fall out naturally if you implement what I said in #23943 (comment):

  • isinstance(x, dict) (or isinstance(x, typing.Dict) should add a narrowing constraint of Top[dict[Unknown, Unknown]] | TypedDictTop
  • that means that the narrowed type of x here would be (dict[str, int] | list[str]) & (Top[dict[Unknown, Unknown]] | TypedDictTop
  • Due to de Morgan's rules, that simplifies to (dict[str, int] & Top[dict[Unknown, Unknown]]) | (dict[str, int] & TypedDictTop) | (list[str] & Top[dict[Unknown, Unknown]]) | (list[str] & TypedDictTop)
  • And that should in turn simplify to dict[str, int] | Never | Never | Never:
    • dict[str, int] is a subtype of Top[dict[Unknown, Unknown]], so dict[str, int] & Top[dict[Unknown, Unknown]] simplifies to dict[str, int]
    • TypedDictTop, and all TypedDict types, should be implemented as being disjoint from any non-structural type that is not a supertype of TypedDictTop: they should be disjoint from both dicst[str, int] and list[str]. If you do that, then both dict[str, int] & TypedDictTop and list[str] & TypedDictTop will naturally simplify to Never in our intersection builder.
    • dict[str, int] is already understood by ty as being disjoint from list[str], so that part should already naturally be simplified to Never in our intersection builder
  • dict[str, int] | Never | Never | Never will naturally be simplified to dict[str, int] by our union builder

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

"Structural types" are TypedDict types (including TypedDictTop itself), Callable types and Protocol types. The only non-structural supertypes of TypedDictTop are Mapping[str, object] and all nominal supertypes of Mapping[str, object].

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

When I make this change, I see the following regression:

from typing import Any, TypedDict

class TD(TypedDict):
    x: int

def f(dt: dict[str, Any], key: str):
    reveal_type(dt.get(key, {"x": 0}))  # revealed: Any
    x: TD = dt.get(key, {"x": 0})
    reveal_type(x)  # current: Any; after the change: Unknown

Trying to figure that out.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

hmm, interesting... I can't immediately say I know why that would be. There might be an unrelated pre-existing bug somewhere? not sure

@charliermarsh charliermarsh force-pushed the charlie/td-narrow branch 2 times, most recently from 3dc84c5 to a840e56 Compare March 16, 2026 01:12
@astral-sh-bot
Copy link
Copy Markdown

astral-sh-bot bot commented Mar 16, 2026

ecosystem-analyzer results

Lint rule Added Removed Changed
invalid-argument-type 10 222 32
no-matching-overload 1 26 0
invalid-return-type 0 8 17
invalid-assignment 5 16 3
unresolved-attribute 2 12 6
not-subscriptable 0 13 0
unsupported-operator 0 7 0
not-iterable 1 2 1
invalid-type-form 0 0 2
invalid-yield 0 1 0
redundant-cast 1 0 0
too-many-positional-arguments 0 1 0
unused-type-ignore-comment 1 0 0
Total 21 308 61

Showing a random sample of 237 of 390 changes. See the HTML report for the full diff.

Raw diff sample (237 of 390 changes)
PyGithub (https://github.com/PyGithub/PyGithub)
- github/AdvisoryCredit.py:97:31 error[invalid-argument-type] Method `__getitem__` of type `bound method Top[dict[Unknown, Unknown]].__getitem__(key: Never, /) -> object` cannot be called with key of type `Literal["login"]` on object of type `Top[dict[Unknown, Unknown]]`
- github/AdvisoryCredit.py:98:31 error[invalid-argument-type] Method `__getitem__` of type `bound method Top[dict[Unknown, Unknown]].__getitem__(key: Never, /) -> object` cannot be called with key of type `Literal["type"]` on object of type `Top[dict[Unknown, Unknown]]`
- github/AdvisoryCredit.py:98:53 error[invalid-argument-type] Method `__getitem__` of type `bound method Top[dict[Unknown, Unknown]].__getitem__(key: Never, /) -> object` cannot be called with key of type `Literal["type"]` on object of type `Top[dict[Unknown, Unknown]]`
- github/AdvisoryCredit.py:113:20 error[invalid-return-type] Return type does not match returned value: expected `SimpleCredit`, found `dict[str, object]`
- github/AdvisoryCredit.py:115:25 error[invalid-argument-type] Invalid argument to key "type" with declared type `str` on TypedDict `SimpleCredit`: value of type `object`
- github/AdvisoryCredit.py:115:25 error[invalid-argument-type] Method `__getitem__` of type `bound method Top[dict[Unknown, Unknown]].__getitem__(key: Never, /) -> object` cannot be called with key of type `Literal["type"]` on object of type `Top[dict[Unknown, Unknown]]`
- github/AdvisoryVulnerability.py:129:59 error[invalid-argument-type] Method `__getitem__` of type `bound method Top[dict[Unknown, Unknown]].__getitem__(key: Never, /) -> object` cannot be called with key of type `Literal["package"]` on object of type `Top[dict[Unknown, Unknown]]`
- github/AdvisoryVulnerability.py:129:59 error[invalid-assignment] Object of type `object` is not assignable to `SimpleAdvisoryVulnerabilityPackage`
- github/AdvisoryVulnerability.py:136:31 error[invalid-argument-type] Method `__getitem__` of type `bound method Top[dict[Unknown, Unknown]].__getitem__(key: Never, /) -> object` cannot be called with key of type `Literal["patched_versions"]` on object of type `Top[dict[Unknown, Unknown]]`
- github/AdvisoryVulnerability.py:142:20 error[invalid-argument-type] Method `__getitem__` of type `bound method Top[dict[Unknown, Unknown]].__getitem__(key: Never, /) -> object` cannot be called with key of type `Literal["vulnerable_functions"]` on object of type `Top[dict[Unknown, Unknown]]`
- github/AdvisoryVulnerability.py:146:31 error[invalid-argument-type] Method `__getitem__` of type `bound method Top[dict[Unknown, Unknown]].__getitem__(key: Never, /) -> object` cannot be called with key of type `Literal["vulnerable_version_range"]` on object of type `Top[dict[Unknown, Unknown]]`
- github/AdvisoryVulnerability.py:158:73 error[invalid-assignment] Object of type `object` is not assignable to `SimpleAdvisoryVulnerabilityPackage`
- github/AdvisoryVulnerability.py:164:37 error[invalid-argument-type] Invalid argument to key "patched_versions" with declared type `str | None` on TypedDict `SimpleAdvisoryVulnerability`: value of type `object`
- github/AdvisoryVulnerability.py:165:41 error[invalid-argument-type] Method `__getitem__` of type `bound method Top[dict[Unknown, Unknown]].__getitem__(key: Never, /) -> object` cannot be called with key of type `Literal["vulnerable_functions"]` on object of type `Top[dict[Unknown, Unknown]]`
- github/AdvisoryVulnerability.py:166:45 error[invalid-argument-type] Invalid argument to key "vulnerable_version_range" with declared type `str | None` on TypedDict `SimpleAdvisoryVulnerability`: value of type `object`
- github/AdvisoryVulnerability.py:166:45 error[invalid-argument-type] Method `__getitem__` of type `bound method Top[dict[Unknown, Unknown]].__getitem__(key: Never, /) -> object` cannot be called with key of type `Literal["vulnerable_version_range"]` on object of type `Top[dict[Unknown, Unknown]]`
- github/AdvisoryVulnerability.py:170:30 error[unresolved-attribute] Attribute `package` is not defined on `SimpleAdvisoryVulnerability & ~Top[dict[Unknown, Unknown]]` in union `(SimpleAdvisoryVulnerability & ~Top[dict[Unknown, Unknown]]) | (AdvisoryVulnerability & ~Top[dict[Unknown, Unknown]])`
- github/AdvisoryVulnerability.py:171:25 error[unresolved-attribute] Attribute `package` is not defined on `SimpleAdvisoryVulnerability & ~Top[dict[Unknown, Unknown]]` in union `(SimpleAdvisoryVulnerability & ~Top[dict[Unknown, Unknown]]) | (AdvisoryVulnerability & ~Top[dict[Unknown, Unknown]])`
- github/AdvisoryVulnerability.py:173:33 error[unresolved-attribute] Attribute `patched_versions` is not defined on `SimpleAdvisoryVulnerability & ~Top[dict[Unknown, Unknown]]` in union `(SimpleAdvisoryVulnerability & ~Top[dict[Unknown, Unknown]]) | (AdvisoryVulnerability & ~Top[dict[Unknown, Unknown]])`
- github/AdvisoryVulnerability.py:174:37 error[unresolved-attribute] Attribute `vulnerable_functions` is not defined on `SimpleAdvisoryVulnerability & ~Top[dict[Unknown, Unknown]]` in union `(SimpleAdvisoryVulnerability & ~Top[dict[Unknown, Unknown]]) | (AdvisoryVulnerability & ~Top[dict[Unknown, Unknown]])`

altair (https://github.com/vega/altair)
- altair/jupyter/jupyter_chart.py:256:29 error[no-matching-overload] No overload of bound method `get` matches arguments
- altair/utils/data.py:161:13 error[invalid-argument-type] Argument to function `len` is incorrect: Expected `Sized`, found `object`
- altair/utils/data.py:193:22 error[invalid-argument-type] Method `__getitem__` of type `bound method Top[dict[Unknown, Unknown]].__getitem__(key: Never, /) -> object` cannot be called with key of type `Literal["values"]` on object of type `Top[dict[Unknown, Unknown]]`
- altair/utils/data.py:193:22 error[invalid-argument-type] Method `__getitem__` of type `bound method Top[dict[Unknown, Unknown]].__getitem__(key: Never, /) -> object` cannot be called with key of type `Literal["values"]` on object of type `Top[dict[Unknown, Unknown]]`
- altair/utils/data.py:193:22 error[invalid-argument-type] Method `__getitem__` of type `bound method Top[dict[Unknown, Unknown]].__getitem__(key: Never, /) -> object` cannot be called with key of type `Literal["values"]` on object of type `Top[dict[Unknown, Unknown]]`
- altair/utils/data.py:198:36 error[invalid-argument-type] Argument to function `len` is incorrect: Expected `Sized`, found `object`
- altair/utils/data.py:199:36 error[invalid-argument-type] Argument to bound method `sample` is incorrect: Expected `Sequence[Unknown] | AbstractSet[Unknown]`, found `object`
- altair/utils/data.py:378:27 error[invalid-argument-type] Method `__getitem__` of type `bound method Top[dict[Unknown, Unknown]].__getitem__(key: Never, /) -> object` cannot be called with key of type `Literal["values"]` on object of type `Top[dict[Unknown, Unknown]]`
- altair/utils/data.py:378:27 error[invalid-argument-type] Method `__getitem__` of type `bound method Top[dict[Unknown, Unknown]].__getitem__(key: Never, /) -> object` cannot be called with key of type `Literal["values"]` on object of type `Top[dict[Unknown, Unknown]]`
- altair/utils/data.py:378:27 error[invalid-argument-type] Method `__getitem__` of type `bound method Top[dict[Unknown, Unknown]].__getitem__(key: Never, /) -> object` cannot be called with key of type `Literal["values"]` on object of type `Top[dict[Unknown, Unknown]]`
- altair/utils/data.py:209:28 error[invalid-argument-type] Argument to function `len` is incorrect: Expected `Sized`, found `(NativeDataFrame & ~DataFrame & ~Top[dict[Unknown, Unknown]]) | (narwhals.stable.v1.typing.DataFrameLike & ~DataFrame & ~Top[dict[Unknown, Unknown]]) | (Unknown & ~None & ~DataFrame & ~Top[dict[Unknown, Unknown]]) | (SupportsGeoInterface & ~DataFrame & ~Top[dict[Unknown, Unknown]]) | (altair.utils.core.DataFrameLike & ~DataFrame & ~Top[dict[Unknown, Unknown]])`
+ altair/utils/data.py:209:28 error[invalid-argument-type] Argument to function `len` is incorrect: Expected `Sized`, found `(NativeDataFrame & ~DataFrame & ~Top[dict[Unknown, Unknown]]) | (narwhals.stable.v1.typing.DataFrameLike & ~DataFrame & ~Top[dict[Unknown, Unknown]]) | (Unknown & ~None & ~DataFrame & ~Top[dict[Unknown, Unknown]] & ~Top[TypedDict]) | (SupportsGeoInterface & ~DataFrame & ~Top[dict[Unknown, Unknown]]) | (altair.utils.core.DataFrameLike & ~DataFrame & ~Top[dict[Unknown, Unknown]])`
- altair/utils/data.py:210:39 error[invalid-argument-type] Argument to function `len` is incorrect: Expected `Sized`, found `(NativeDataFrame & ~DataFrame & ~Top[dict[Unknown, Unknown]]) | (narwhals.stable.v1.typing.DataFrameLike & ~DataFrame & ~Top[dict[Unknown, Unknown]]) | (Unknown & ~None & ~DataFrame & ~Top[dict[Unknown, Unknown]]) | (SupportsGeoInterface & ~DataFrame & ~Top[dict[Unknown, Unknown]]) | (altair.utils.core.DataFrameLike & ~DataFrame & ~Top[dict[Unknown, Unknown]])`
+ altair/utils/data.py:210:39 error[invalid-argument-type] Argument to function `len` is incorrect: Expected `Sized`, found `(NativeDataFrame & ~DataFrame & ~Top[dict[Unknown, Unknown]]) | (narwhals.stable.v1.typing.DataFrameLike & ~DataFrame & ~Top[dict[Unknown, Unknown]]) | (Unknown & ~None & ~DataFrame & ~Top[dict[Unknown, Unknown]] & ~Top[TypedDict]) | (SupportsGeoInterface & ~DataFrame & ~Top[dict[Unknown, Unknown]]) | (altair.utils.core.DataFrameLike & ~DataFrame & ~Top[dict[Unknown, Unknown]])`
- altair/utils/data.py:416:12 error[unresolved-attribute] Attribute `write_csv` is not defined on `NativeDataFrame & ~SupportsGeoInterface & ~DataFrame & ~Top[dict[Unknown, Unknown]]`, `DataFrameLike & ~SupportsGeoInterface & ~DataFrame & ~Top[dict[Unknown, Unknown]]`, `DataFrameLike & ~SupportsGeoInterface & ~DataFrame & ~Top[dict[Unknown, Unknown]]` in union `(NativeDataFrame & ~SupportsGeoInterface & ~DataFrame & ~Top[dict[Unknown, Unknown]]) | (narwhals.stable.v1.typing.DataFrameLike & ~SupportsGeoInterface & ~DataFrame & ~Top[dict[Unknown, Unknown]]) | (Unknown & ~SupportsGeoInterface & ~DataFrame & ~Top[dict[Unknown, Unknown]]) | (altair.utils.core.DataFrameLike & ~SupportsGeoInterface & ~DataFrame & ~Top[dict[Unknown, Unknown]])`
+ altair/utils/data.py:416:12 error[unresolved-attribute] Attribute `write_csv` is not defined on `NativeDataFrame & ~SupportsGeoInterface & ~DataFrame & ~Top[dict[Unknown, Unknown]]`, `DataFrameLike & ~SupportsGeoInterface & ~DataFrame & ~Top[dict[Unknown, Unknown]]`, `DataFrameLike & ~SupportsGeoInterface & ~DataFrame & ~Top[dict[Unknown, Unknown]]` in union `(NativeDataFrame & ~SupportsGeoInterface & ~DataFrame & ~Top[dict[Unknown, Unknown]]) | (narwhals.stable.v1.typing.DataFrameLike & ~SupportsGeoInterface & ~DataFrame & ~Top[dict[Unknown, Unknown]]) | (Unknown & ~SupportsGeoInterface & ~DataFrame & ~Top[dict[Unknown, Unknown]] & ~Top[TypedDict]) | (altair.utils.core.DataFrameLike & ~SupportsGeoInterface & ~DataFrame & ~Top[dict[Unknown, Unknown]])`
- altair/vegalite/v6/api.py:255:18 error[invalid-argument-type] Method `__getitem__` of type `bound method Top[dict[Unknown, Unknown]].__getitem__(key: Never, /) -> object` cannot be called with key of type `Literal["values"]` on object of type `Top[dict[Unknown, Unknown]]`
- altair/vegalite/v6/api.py:255:18 error[invalid-argument-type] Method `__getitem__` of type `bound method Top[dict[Unknown, Unknown]].__getitem__(key: Never, /) -> object` cannot be called with key of type `Literal["values"]` on object of type `Top[dict[Unknown, Unknown]]`
- altair/vegalite/v6/api.py:255:18 error[invalid-argument-type] Method `__getitem__` of type `bound method Top[dict[Unknown, Unknown]].__getitem__(key: Never, /) -> object` cannot be called with key of type `Literal["values"]` on object of type `Top[dict[Unknown, Unknown]]`
- altair/vegalite/v6/api.py:255:18 error[invalid-argument-type] Method `__getitem__` of type `bound method Top[dict[Unknown, Unknown]].__getitem__(key: Never, /) -> object` cannot be called with key of type `Literal["values"]` on object of type `Top[dict[Unknown, Unknown]]`
- altair/vegalite/v6/api.py:1179:45 error[invalid-argument-type] Argument to function `_reveal_parsed_shorthand` is incorrect: Expected `Mapping[str, Any]`, found `_C@Then & Top[dict[Unknown, Unknown]]`
- altair/vegalite/v6/api.py:908:5 error[no-matching-overload] No overload of bound method `update` matches arguments
+ altair/vegalite/v6/api.py:908:22 error[invalid-argument-type] Argument to bound method `update` is incorrect: Argument type `dict[str, Any]` does not satisfy upper bound `Top[TypedDict]` of type variable `Self`
+ altair/vegalite/v6/api.py:908:22 error[invalid-argument-type] Argument to bound method `update` is incorrect: Expected `Top[TypedDict]`, found `dict[str, Any]`
- altair/vegalite/v6/api.py:909:12 error[invalid-return-type] Return type does not match returned value: expected `dict[str, Any]`, found `(Mapping[str, Any] & Top[dict[Unknown, Unknown]] & ~SchemaBase) | dict[str, Any]`
+ altair/vegalite/v6/api.py:909:12 error[invalid-return-type] Return type does not match returned value: expected `dict[str, Any]`, found `(Mapping[str, Any] & Top[dict[Unknown, Unknown]] & ~SchemaBase) | (Mapping[str, Any] & Top[TypedDict]) | dict[str, Any]`

apprise (https://github.com/caronc/apprise)
- apprise/config/base.py:1116:31 error[no-matching-overload] No overload of bound method `match` matches arguments
- apprise/config/base.py:1179:29 error[no-matching-overload] No overload of bound method `update` matches arguments
- apprise/config/base.py:1188:37 error[invalid-argument-type] Argument to function `_special_token_handler` is incorrect: Expected `dict[str, object]`, found `Top[dict[Unknown, Unknown]]`

artigraph (https://github.com/artigraph/artigraph)
- src/arti/internal/type_hints.py:161:25 error[invalid-type-form] Variable of type `type` is not allowed in a type expression
+ src/arti/internal/type_hints.py:161:25 error[invalid-type-form] Variable of type `type[Unknown]` is not allowed in a type expression
- src/arti/internal/type_hints.py:161:41 error[invalid-type-form] Variable of type `type` is not allowed in a type expression
+ src/arti/internal/type_hints.py:161:41 error[invalid-type-form] Variable of type `type[Unknown]` is not allowed in a type expression
- src/arti/storage/_internal.py:146:9 error[invalid-assignment] Invalid subscript assignment with key of type `Unknown` and value of type `object` on object of type `dict[str, str]`

bokeh (https://github.com/bokeh/bokeh)
- src/bokeh/core/property/bases.py:264:41 error[invalid-argument-type] Method `__getitem__` of type `bound method Top[dict[Unknown, Unknown]].__getitem__(key: Never, /) -> object` cannot be called with key of type `object` on object of type `Top[dict[Unknown, Unknown]]`
- src/bokeh/embed/standalone.py:266:76 error[invalid-argument-type] Argument to function `standalone_docs_json_and_render_items` is incorrect: Expected `Model | Document | Sequence[Model | Document]`, found `Model | Sequence[Model] | dict[str, Model]`
- src/bokeh/embed/standalone.py:265:28 error[invalid-argument-type] Argument is incorrect: Expected `Sequence[Model]`, found `Model | Sequence[Model] | dict[str, Model]`
+ src/bokeh/embed/standalone.py:265:28 error[invalid-argument-type] Argument is incorrect: Expected `Sequence[Model]`, found `(Model & ~Top[dict[Unknown, Unknown]]) | (Sequence[Model] & ~Top[dict[Unknown, Unknown]]) | list[Unknown]`

cloud-init (https://github.com/canonical/cloud-init)
- cloudinit/config/cc_ubuntu_pro.py:129:16 error[no-matching-overload] No overload of function `search` matches arguments
- cloudinit/config/cc_ubuntu_pro.py:130:48 error[invalid-argument-type] Argument to function `escape` is incorrect: Argument type `~None` does not satisfy constraints (`str`, `bytes`) of type variable `AnyStr`
- cloudinit/config/cc_ubuntu_pro.py:140:27 error[no-matching-overload] No overload of bound method `replace` matches arguments

core (https://github.com/home-assistant/core)
- homeassistant/auth/permissions/merge.py:63:43 error[invalid-argument-type] Argument to function `_merge_policies` is incorrect: Expected `list[CategoryType]`, found `list[SubCategoryType | None]`
+ homeassistant/auth/permissions/merge.py:63:43 error[invalid-argument-type] Argument to function `_merge_policies` is incorrect: Expected `list[CategoryType]`, found `list[Mapping[str, ValueType] | bool | None]`
- homeassistant/auth/permissions/util.py:113:12 error[invalid-return-type] Return type does not match returned value: expected `bool`, found `ValueType`
+ homeassistant/auth/permissions/util.py:113:12 error[invalid-return-type] Return type does not match returned value: expected `bool`, found `Mapping[str, bool] | bool | None`
- homeassistant/components/asuswrt/helpers.py:44:16 error[invalid-return-type] Return type does not match returned value: expected `T@translate_to_legacy`, found `dict[Unknown, object]`
+ homeassistant/components/asuswrt/helpers.py:44:16 error[invalid-return-type] Return type does not match returned value: expected `T@translate_to_legacy`, found `dict[Unknown, Unknown]`
- homeassistant/components/google_assistant/http.py:413:12 error[invalid-return-type] Return type does not match returned value: expected `list[str]`, found `list[object]`

cwltool (https://github.com/common-workflow-language/cwltool)
- tests/test_examples.py:327:12 error[not-subscriptable] Cannot subscript object of type `None` with no `__getitem__` method
- tests/test_examples.py:327:12 error[not-subscriptable] Cannot subscript object of type `int` with no `__getitem__` method
- tests/test_examples.py:327:12 error[invalid-argument-type] Method `__getitem__` of type `Overload[(key: SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> LiteralString, (key: SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> str]` cannot be called with key of type `Literal["checksum"]` on object of type `str`
- tests/test_examples.py:328:12 error[invalid-argument-type] Method `__getitem__` of type `bound method MutableMapping[str, Divergent].__getitem__(key: str, /) -> Divergent` cannot be called with key of type `Literal[1]` on object of type `MutableMapping[str, Divergent]`
- tests/test_examples.py:329:12 error[not-subscriptable] Cannot subscript object of type `None` with no `__getitem__` method
- tests/test_examples.py:329:12 error[not-subscriptable] Cannot subscript object of type `float` with no `__getitem__` method
- tests/test_examples.py:329:12 error[invalid-argument-type] Method `__getitem__` of type `Overload[(key: SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> LiteralString, (key: SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> str]` cannot be called with key of type `Literal["checksum"]` on object of type `str`
- tests/test_examples.py:329:12 error[invalid-argument-type] Method `__getitem__` of type `bound method MutableMapping[str, Divergent].__getitem__(key: str, /) -> Divergent` cannot be called with key of type `Literal[2]` on object of type `MutableMapping[str, Divergent]`
- tests/test_examples.py:342:12 error[not-subscriptable] Cannot subscript object of type `None` with no `__getitem__` method
- tests/test_examples.py:342:12 error[not-subscriptable] Cannot subscript object of type `float` with no `__getitem__` method
- tests/test_examples.py:342:12 error[not-subscriptable] Cannot subscript object of type `int` with no `__getitem__` method
- tests/test_examples.py:342:12 error[invalid-argument-type] Method `__getitem__` of type `Overload[(key: SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> LiteralString, (key: SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> str]` cannot be called with key of type `Literal["checksum"]` on object of type `str`
- tests/test_examples.py:1449:12 error[invalid-argument-type] Method `__getitem__` of type `Overload[(index: int, /) -> Divergent, (index: slice[int | None, int | None, int | None], /) -> MutableSequence[Divergent]]` cannot be called with key of type `Literal["checksum"]` on object of type `MutableSequence[Divergent]`
- tests/test_examples.py:1449:12 error[invalid-argument-type] Method `__getitem__` of type `bound method Top[dict[Unknown, Unknown]].__getitem__(key: Never, /) -> object` cannot be called with key of type `Literal["checksum"]` on object of type `Top[dict[Unknown, Unknown]]`
- tests/test_examples.py:1694:28 error[invalid-argument-type] Method `__getitem__` of type `Overload[(key: SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> LiteralString, (key: SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> str]` cannot be called with key of type `Literal["location"]` on object of type `str`
- tests/test_examples.py:1694:63 error[not-iterable] Object of type `None | int | str | ... omitted 3 union elements` may not be iterable
- tests/test_secrets.py:31:41 error[invalid-argument-type] Method `__getitem__` of type `Overload[(index: int, /) -> Divergent, (index: slice[int | None, int | None, int | None], /) -> MutableSequence[Divergent]]` cannot be called with key of type `Literal["foo"]` on object of type `MutableSequence[Divergent]`
- cwltool/job.py:180:46 error[no-matching-overload] No overload of bound method `get` matches arguments
- cwltool/job.py:181:39 error[no-matching-overload] No overload of bound method `get` matches arguments
- cwltool/process.py:314:24 error[invalid-argument-type] Argument to bound method `get` is incorrect: Expected `Never`, found `Literal["class"]`
- cwltool/process.py:318:51 error[invalid-argument-type] Argument to function `_collectDirEntries` is incorrect: Expected `MutableMapping[str, None | int | str | ... omitted 3 union elements] | MutableSequence[MutableMapping[str, None | int | str | ... omitted 3 union elements]] | None`, found `object`

dd-trace-py (https://github.com/DataDog/dd-trace-py)
- ddtrace/internal/remoteconfig/__init__.py:35:44 error[invalid-argument-type] Argument expression after ** must be a mapping with `str` key type: Found `object`
- ddtrace/appsec/_asm_request_context.py:241:32 error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `int`, found `Any | str | int | None`
- ddtrace/appsec/_asm_request_context.py:241:32 error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `str`, found `Any | str | int | None`
- ddtrace/appsec/_asm_request_context.py:241:32 error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `str`, found `Any | str | int | None`
- ddtrace/appsec/_asm_request_context.py:241:32 error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `str`, found `Any | str | int | None`
- ddtrace/contrib/internal/botocore/services/stepfunctions.py:37:58 error[invalid-argument-type] Argument to function `dispatch` is incorrect: Expected `tuple[Any, ...]`, found `list[ExecutionContext[Unknown] | None | (Any & Top[dict[Unknown, Unknown]])]`
+ ddtrace/contrib/internal/botocore/services/stepfunctions.py:37:58 error[invalid-argument-type] Argument to function `dispatch` is incorrect: Expected `tuple[Any, ...]`, found `list[ExecutionContext[Unknown] | None | (Any & Top[dict[Unknown, Unknown]]) | (Any & Top[TypedDict])]`
- ddtrace/contrib/internal/pymongo/utils.py:146:26 error[no-matching-overload] No overload of bound method `get` matches arguments
- ddtrace/internal/remoteconfig/client.py:170:35 error[invalid-argument-type] Argument expression after ** must be a mapping with `str` key type: Found `object`
- ddtrace/llmobs/_evaluators/llm_judge.py:817:50 error[invalid-argument-type] Argument to function `_format_schema_for_provider` is incorrect: Expected `dict[str, Any]`, found `(Unknown & Top[dict[Unknown, Unknown]]) | (BooleanStructuredOutput & Top[dict[Unknown, Unknown]]) | (ScoreStructuredOutput & Top[dict[Unknown, Unknown]]) | (CategoricalStructuredOutput & Top[dict[Unknown, Unknown]]) | dict[str, str | int | float | ... omitted 3 union elements]`
+ ddtrace/llmobs/_evaluators/llm_judge.py:817:50 error[invalid-argument-type] Argument to function `_format_schema_for_provider` is incorrect: Expected `dict[str, Any]`, found `(Unknown & Top[dict[Unknown, Unknown]]) | (BooleanStructuredOutput & Top[dict[Unknown, Unknown]]) | (ScoreStructuredOutput & Top[dict[Unknown, Unknown]]) | ... omitted 3 union elements`
- ddtrace/llmobs/_integrations/bedrock_agents.py:116:31 error[invalid-argument-type] Argument to bound method `get` is incorrect: Expected `Never`, found `Literal["traceId"]`
- ddtrace/llmobs/_integrations/bedrock_agents.py:120:12 error[unresolved-attribute] Object of type `object` has no attribute `get`
- ddtrace/llmobs/_utils.py:205:16 error[no-matching-overload] No overload of bound method `get` matches arguments

freqtrade (https://github.com/freqtrade/freqtrade)
- freqtrade/util/rich_tables.py:32:21 error[invalid-argument-type] Method `__getitem__` of type `bound method Top[dict[Unknown, Unknown]].__getitem__(key: Never, /) -> object` cannot be called with key of type `str` on object of type `Top[dict[Unknown, Unknown]]`
- freqtrade/util/rich_tables.py:32:47 error[invalid-argument-type] Method `__getitem__` of type `bound method Top[dict[Unknown, Unknown]].__getitem__(key: Never, /) -> object` cannot be called with key of type `str` on object of type `Top[dict[Unknown, Unknown]]`
- freqtrade/util/rich_tables.py:32:75 error[invalid-argument-type] Method `__getitem__` of type `Overload[(index: int, /) -> str | Unknown, (index: slice[int | None, int | None, int | None], /) -> Sequence[str | Unknown]]` cannot be called with key of type `str` on object of type `Sequence[str | Unknown]`
- freqtrade/util/rich_tables.py:32:75 error[invalid-argument-type] Method `__getitem__` of type `bound method Top[dict[Unknown, Unknown]].__getitem__(key: Never, /) -> object` cannot be called with key of type `str` on object of type `Top[dict[Unknown, Unknown]]`

graphql-core (https://github.com/graphql-python/graphql-core)
- src/graphql/error/graphql_error.py:213:58 error[invalid-argument-type] Argument to function `getattr` is incorrect: Expected `str`, found `~Literal["original_error"]`
- src/graphql/error/graphql_error.py:213:77 error[invalid-argument-type] Argument to bound method `get` is incorrect: Expected `Never`, found `~Literal["original_error"]`
- src/graphql/execution/types.py:106:28 error[invalid-argument-type] Argument to bound method `get` is incorrect: Expected `Never`, found `Literal["data"]`
- src/graphql/execution/types.py:107:32 error[invalid-argument-type] Argument to bound method `get` is incorrect: Expected `Never`, found `Literal["errors"]`
- src/graphql/execution/types.py:108:32 error[invalid-argument-type] Argument to bound method `get` is incorrect: Expected `Never`, found `Literal["extensions"]`
- src/graphql/execution/types.py:193:27 error[invalid-argument-type] Argument to bound method `get` is incorrect: Expected `Never`, found `Literal["data"]`
- src/graphql/execution/types.py:194:32 error[invalid-argument-type] Argument to bound method `get` is incorrect: Expected `Never`, found `Literal["errors"]`
- src/graphql/execution/types.py:196:32 error[invalid-argument-type] Argument to bound method `get` is incorrect: Expected `Never`, found `Literal["hasNext"]`
- src/graphql/execution/types.py:294:28 error[invalid-argument-type] Argument to bound method `get` is incorrect: Expected `Never`, found `Literal["hasNext"]`
- src/graphql/execution/types.py:295:32 error[invalid-argument-type] Argument to bound method `get` is incorrect: Expected `Never`, found `Literal["pending"]`
- src/graphql/execution/types.py:296:32 error[invalid-argument-type] Argument to bound method `get` is incorrect: Expected `Never`, found `Literal["incremental"]`
- src/graphql/execution/types.py:297:32 error[invalid-argument-type] Argument to bound method `get` is incorrect: Expected `Never`, found `Literal["completed"]`
- src/graphql/execution/types.py:298:32 error[invalid-argument-type] Argument to bound method `get` is incorrect: Expected `Never`, found `Literal["extensions"]`
- src/graphql/execution/types.py:412:31 error[invalid-argument-type] Argument to bound method `get` is incorrect: Expected `Never`, found `Literal["id"]`
- src/graphql/execution/types.py:415:32 error[invalid-argument-type] Argument to bound method `get` is incorrect: Expected `Never`, found `Literal["extensions"]`
- src/graphql/execution/types.py:520:31 error[invalid-argument-type] Argument to bound method `get` is incorrect: Expected `Never`, found `Literal["id"]`
- src/graphql/execution/types.py:617:27 error[invalid-argument-type] Argument to bound method `get` is incorrect: Expected `Never`, found `Literal["id"]`
- src/graphql/execution/types.py:618:32 error[invalid-argument-type] Argument to bound method `get` is incorrect: Expected `Never`, found `Literal["path"]`
- src/graphql/execution/types.py:669:62 error[invalid-argument-type] Argument to bound method `get` is incorrect: Expected `Never`, found `Literal["errors"]`

ibis (https://github.com/ibis-project/ibis)
- ibis/backends/sql/ddl.py:82:54 error[invalid-argument-type] Method `__getitem__` of type `bound method Top[dict[Unknown, Unknown]].__getitem__(key: Never, /) -> object` cannot be called with key of type `str` on object of type `Top[dict[Unknown, Unknown]]`

ignite (https://github.com/pytorch/ignite)
- tests/ignite/test_utils.py:49:28 error[invalid-argument-type] Method `__getitem__` of type `Overload[(index: int, /) -> Unknown, (index: slice[int | None, int | None, int | None], /) -> Sequence[Unknown]]` cannot be called with key of type `Literal["a"]` on object of type `Sequence[Unknown]`
- tests/ignite/test_utils.py:50:28 error[invalid-argument-type] Method `__getitem__` of type `bound method Top[dict[Unknown, Unknown]].__getitem__(key: Never, /) -> object` cannot be called with key of type `Literal["b"]` on object of type `Top[dict[Unknown, Unknown]]`

jax (https://github.com/google/jax)
- jax/_src/pallas/core.py:1469:60 error[invalid-argument-type] Argument to function `debug_info` is incorrect: Expected `dict[str, Any]`, found `(Sequence[Divergent] & Top[dict[Unknown, Unknown]]) | (Mapping[str, Divergent] & Top[dict[Unknown, Unknown]]) | dict[Unknown, Unknown]`
+ jax/_src/pallas/core.py:1469:60 error[invalid-argument-type] Argument to function `debug_info` is incorrect: Expected `dict[str, Any]`, found `(Sequence[Divergent] & Top[dict[Unknown, Unknown]]) | (Mapping[str, Divergent] & Top[dict[Unknown, Unknown]]) | (Mapping[str, Divergent] & Top[TypedDict]) | dict[Unknown, Unknown]`

jinja (https://github.com/pallets/jinja)
- src/jinja2/filters.py:169:48 error[invalid-assignment] Object of type `dict_items[object, object]` is not assignable to `Iterable[tuple[str, Any]]`

meson (https://github.com/mesonbuild/meson)
- mesonbuild/modules/sourceset.py:243:29 error[no-matching-overload] No overload of bound method `get` matches arguments
- mesonbuild/modules/sourceset.py:243:50 error[too-many-positional-arguments] Too many positional arguments to bound method `get`: expected 2, got 3
- mesonbuild/build.py:436:24 error[invalid-return-type] Return type does not match returned value: expected `_T@copy_value`, found `list[Never] | dict[Never, Never] | set[Never]`
+ mesonbuild/build.py:436:24 error[invalid-return-type] Return type does not match returned value: expected `_T@copy_value`, found `list[Never] | dict[Never, Never] | Top[TypedDict] | set[Never]`
- mesonbuild/cargo/manifest.py:143:36 error[no-matching-overload] No overload of bound method `get` matches arguments
- mesonbuild/interpreter/type_checking.py:252:37 error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `dict[str, str | list[str]] | None`, found `dict[object, str | list[str]]`
- mesonbuild/interpreterbase/helpers.py:60:54 error[invalid-argument-type] Argument to function `stringifyUserArguments` is incorrect: Expected `Sequence[Divergent] | int | dict[str, Divergent] | ... omitted 5 union elements`, found `object`
- mesonbuild/interpreterbase/interpreterbase.py:615:41 error[invalid-argument-type] Argument to bound method `_holderify` is incorrect: Expected `Sequence[Divergent] | int | dict[str, Divergent] | ... omitted 5 union elements`, found `object`

mkdocs (https://github.com/mkdocs/mkdocs)
- mkdocs/config/config_options.py:834:49 error[invalid-argument-type] Method `__getitem__` of type `bound method Top[dict[Unknown, Unknown]].__getitem__(key: Never, /) -> object` cannot be called with key of type `Literal["name"]` on object of type `Top[dict[Unknown, Unknown]]`
- mkdocs/config/config_options.py:855:56 error[invalid-argument-type] Method `__getitem__` of type `bound method Top[dict[Unknown, Unknown]].__getitem__(key: Never, /) -> object` cannot be called with key of type `Literal["locale"]` on object of type `Top[dict[Unknown, Unknown]]`
+ mkdocs/config/config_options.py:283:9 error[invalid-assignment] Object of type `(Top[dict[Unknown, Unknown]] & ~AlwaysFalsy) | (Top[TypedDict] & ~AlwaysFalsy)` is not assignable to attribute `data` of type `dict[Unknown, Unknown]`
+ mkdocs/config/config_options.py:1007:32 error[unresolved-attribute] Attribute `popitem` is not defined on `Top[TypedDict]` in union `Top[dict[Unknown, Unknown]] | Top[TypedDict]`
+ mkdocs/config/config_options.py:139:56 error[invalid-argument-type] Argument to bound method `setdefault` is incorrect: Expected `Never`, found `str`
- mkdocs/config/config_options.py:274:20 error[invalid-return-type] Return type does not match returned value: expected `dict[str, T@DictOfItems]`, found `Top[dict[Unknown, Unknown]] & ~AlwaysTruthy`
+ mkdocs/config/config_options.py:274:20 error[invalid-return-type] Return type does not match returned value: expected `dict[str, T@DictOfItems]`, found `(Top[dict[Unknown, Unknown]] & ~AlwaysTruthy) | (Top[TypedDict] & ~AlwaysTruthy)`
- mkdocs/config/config_options.py:844:63 error[invalid-argument-type] Method `__getitem__` of type `bound method Top[dict[Unknown, Unknown]].__getitem__(key: Never, /) -> object` cannot be called with key of type `Literal["custom_dir"]` on object of type `Top[dict[Unknown, Unknown]]`
- mkdocs/config/config_options.py:846:67 error[invalid-argument-type] Method `__getitem__` of type `bound method Top[dict[Unknown, Unknown]].__getitem__(key: Never, /) -> object` cannot be called with key of type `Literal["custom_dir"]` on object of type `Top[dict[Unknown, Unknown]]`
+ mkdocs/config/config_options.py:846:13 error[invalid-assignment] Cannot assign to a subscript on an object of type `Top[TypedDict]`
- mkdocs/config/config_options.py:858:28 error[invalid-argument-type] Argument expression after ** must be a mapping with `str` key type: Found `object`
+ mkdocs/config/config_options.py:858:28 error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `Collection[str]`, found `object`
+ mkdocs/config/config_options.py:858:28 error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `str | None`, found `object`

mongo-python-driver (https://github.com/mongodb/mongo-python-driver)
+ pymongo/asynchronous/topology.py:859:57 error[invalid-argument-type] Argument to function `_is_stale_error_topology_version` is incorrect: Expected `Mapping[str, Any] | None`, found `object`
- pymongo/collation.py:225:16 error[invalid-return-type] Return type does not match returned value: expected `dict[str, Any] | None`, found `Mapping[str, Any] & Top[dict[Unknown, Unknown]]`
+ pymongo/collation.py:225:16 error[invalid-return-type] Return type does not match returned value: expected `dict[str, Any] | None`, found `(Mapping[str, Any] & Top[dict[Unknown, Unknown]]) | (Mapping[str, Any] & Top[TypedDict])`
- pymongo/errors.py:106:43 error[invalid-argument-type] Argument to bound method `get` is incorrect: Expected `Never`, found `Literal["errorLabels"]`
- pymongo/synchronous/topology.py:855:46 error[invalid-argument-type] Argument to bound method `get` is incorrect: Expected `Never`, found `Literal["topologyVersion"]`

mypy (https://github.com/python/mypy)
- mypy/test/test_diff_cache.py:125:42 error[unsupported-operator] Operator `in` is not supported between objects of type `Literal["/b."]` and `object`
- mypy/test/test_diff_cache.py:125:56 error[unresolved-attribute] Object of type `object` has no attribute `startswith`
- mypy/test/test_diff_cache.py:126:42 error[unsupported-operator] Operator `in` is not supported between objects of type `Literal["/c."]` and `object`
- mypy/test/test_diff_cache.py:126:56 error[unresolved-attribute] Object of type `object` has no attribute `startswith`
- mypy/test/test_diff_cache.py:127:42 error[unsupported-operator] Operator `in` is not supported between objects of type `Literal["/a."]` and `object`
- mypy/test/test_diff_cache.py:127:56 error[unresolved-attribute] Object of type `object` has no attribute `startswith`
- mypy/config_parser.py:561:25 error[unresolved-attribute] Object of type `Mapping[str, Any] & ~Top[dict[Unknown, Unknown]]` has no attribute `getboolean`
+ mypy/config_parser.py:561:25 error[unresolved-attribute] Object of type `Mapping[str, Any] & ~Top[dict[Unknown, Unknown]] & ~Top[TypedDict]` has no attribute `getboolean`
- mypy/server/astdiff.py:157:78 error[invalid-argument-type] Argument to function `compare_symbol_table_snapshots` is incorrect: Expected `dict[str, tuple[object, ...]]`, found `Top[dict[Unknown, Unknown]]`
+ mypy/server/astdiff.py:157:78 error[invalid-argument-type] Argument to function `compare_symbol_table_snapshots` is incorrect: Expected `dict[str, tuple[object, ...]]`, found `Top[dict[Unknown, Unknown]] | Top[TypedDict]`

openlibrary (https://github.com/internetarchive/openlibrary)
- openlibrary/plugins/openlibrary/lists.py:125:23 error[invalid-yield] Yield type `dict[str, dict[str, ThingReferenceDict | str | AnnotatedSeedDict]]` does not match annotated yield type `AnnotatedSeedDict`
- openlibrary/plugins/upstream/utils.py:371:49 error[no-matching-overload] No overload of function `sorted` matches arguments

operator (https://github.com/canonical/operator)
- ops/_private/harness.py:3355:38 error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `str | LayerDict | None`, found `str | (LayerDict & Top[dict[Unknown, Unknown]]) | (Layer & Top[dict[Unknown, Unknown]])`
+ ops/_private/harness.py:3355:38 error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `str | LayerDict | None`, found `str | (Layer & Top[dict[Unknown, Unknown]]) | LayerDict`

pandas (https://github.com/pandas-dev/pandas)
- pandas/core/frame.py:637:56 error[invalid-argument-type] Argument to function `construct_1d_arraylike_from_scalar` is incorrect: Expected `str | bytes | date | ... omitted 10 union elements`, found `(Unknown & ~DataFrame & ~BlockManager & ~None & ~Top[dict[Unknown, Unknown]] & ~ndarray[tuple[object, ...], dtype[object]] & ~Series & ~Index & ~ExtensionArray) | (list[Unknown] & ~BlockManager & ~ndarray[tuple[object, ...], dtype[object]] & ~Series & ~Index & ~ExtensionArray)`
+ pandas/core/frame.py:637:56 error[invalid-argument-type] Argument to function `construct_1d_arraylike_from_scalar` is incorrect: Expected `str | bytes | date | ... omitted 10 union elements`, found `(Unknown & ~DataFrame & ~BlockManager & ~None & ~Top[dict[Unknown, Unknown]] & ~Top[TypedDict] & ~ndarray[tuple[object, ...], dtype[object]] & ~Series & ~Index & ~ExtensionArray) | (list[Unknown] & ~BlockManager & ~ndarray[tuple[object, ...], dtype[object]] & ~Series & ~Index & ~ExtensionArray)`
- pandas/core/frame.py:643:21 error[invalid-argument-type] Argument to function `construct_2d_arraylike_from_scalar` is incorrect: Expected `str | bytes | date | ... omitted 10 union elements`, found `(Unknown & ~DataFrame & ~BlockManager & ~None & ~Top[dict[Unknown, Unknown]] & ~ndarray[tuple[object, ...], dtype[object]] & ~Series & ~Index & ~ExtensionArray) | (list[Unknown] & ~BlockManager & ~ndarray[tuple[object, ...], dtype[object]] & ~Series & ~Index & ~ExtensionArray)`
+ pandas/core/frame.py:643:21 error[invalid-argument-type] Argument to function `construct_2d_arraylike_from_scalar` is incorrect: Expected `str | bytes | date | ... omitted 10 union elements`, found `(Unknown & ~DataFrame & ~BlockManager & ~None & ~Top[dict[Unknown, Unknown]] & ~Top[TypedDict] & ~ndarray[tuple[object, ...], dtype[object]] & ~Series & ~Index & ~ExtensionArray) | (list[Unknown] & ~BlockManager & ~ndarray[tuple[object, ...], dtype[object]] & ~Series & ~Index & ~ExtensionArray)`
- pandas/io/json/_json.py:1275:36 error[invalid-argument-type] Argument to bound method `get` is incorrect: Expected `Never`, found `Hashable`
- pandas/io/parsers/arrow_parser_wrapper.py:201:32 error[unresolved-attribute] Attribute `get` is not defined on `dtype[Any]`, `ExtensionDtype` in union `(Unknown & ~None) | dict[object, dtype[Any] | ExtensionDtype] | dtype[Any] | ExtensionDtype`
+ pandas/io/parsers/arrow_parser_wrapper.py:201:32 error[unresolved-attribute] Attribute `get` is not defined on `dtype[Any]`, `ExtensionDtype` in union `(Unknown & ~None) | dict[Divergent, dtype[Any] | ExtensionDtype] | dtype[Any] | ExtensionDtype`
- pandas/io/parsers/c_parser_wrapper.py:392:33 error[invalid-argument-type] Method `__getitem__` of type `bound method Top[dict[Unknown, Unknown]].__getitem__(key: Never, /) -> object` cannot be called with key of type `object` on object of type `Top[dict[Unknown, Unknown]]`

pip (https://github.com/pypa/pip)
- src/pip/_vendor/dependency_groups/_implementation.py:149:56 error[invalid-argument-type] Argument is incorrect: Expected `str`, found `object`
- src/pip/_vendor/pkg_resources/__init__.py:2840:21 error[invalid-assignment] Object of type `dict_items[object, object]` is not assignable to `Iterable[tuple[str | None, Iterable[str]]]`
+ src/pip/_vendor/pkg_resources/__init__.py:2840:21 error[invalid-assignment] Object of type `ItemsView[Unknown, Unknown] | dict_items[str, object]` is not assignable to `Iterable[tuple[str | None, Iterable[str]]]`

porcupine (https://github.com/Akuli/porcupine)
- porcupine/plugins/filetypes.py:33:49 error[invalid-argument-type] Method `__getitem__` of type `bound method Top[dict[Unknown, Unknown]].__getitem__(key: Never, /) -> object` cannot be called with key of type `object` on object of type `Top[dict[Unknown, Unknown]]`
- porcupine/plugins/filetypes.py:33:70 error[invalid-argument-type] Method `__getitem__` of type `bound method Top[dict[Unknown, Unknown]].__getitem__(key: Never, /) -> object` cannot be called with key of type `object` on object of type `Top[dict[Unknown, Unknown]]`

prefect (https://github.com/PrefectHQ/prefect)
- src/prefect/cli/events.py:198:9 error[invalid-argument-type] Argument is incorrect: Expected `list[RelatedResource]`, found `(list[Any & Top[dict[Unknown, Unknown]]] & ~AlwaysFalsy) | (Any & Top[list[Unknown]] & ~AlwaysFalsy) | list[Unknown]`
+ src/prefect/cli/events.py:198:9 error[invalid-argument-type] Argument is incorrect: Expected `list[RelatedResource]`, found `(list[(Any & Top[dict[Unknown, Unknown]]) | (Any & Top[TypedDict])] & ~AlwaysFalsy) | (Any & Top[list[Unknown]] & ~AlwaysFalsy) | list[Unknown]`
- src/prefect/utilities/templating.py:330:29 error[no-matching-overload] No overload of bound method `get` matches arguments
- src/prefect/utilities/templating.py:339:13 error[invalid-assignment] Invalid subscript assignment with key of type `object` and value of type `Unknown` on object of type `dict[str, Any]`

psycopg (https://github.com/psycopg/psycopg)
- psycopg/psycopg/errors.py:514:38 error[invalid-argument-type] Argument to bound method `get` is incorrect: Expected `Never`, found `DiagnosticField`

pydantic (https://github.com/pydantic/pydantic)
- pydantic/_internal/_core_metadata.py:87:54 error[invalid-assignment] Invalid assignment to key "pydantic_js_extra" with declared type `dict[str, Divergent] | ((dict[str, Divergent], /) -> None) | ((dict[str, Divergent], type[Any], /) -> None)` on TypedDict `CoreMetadata`: value of type `dict[object, object]`
- pydantic/fields.py:1575:13 error[invalid-argument-type] Argument is incorrect: Expected `dict[str, Divergent] | ((dict[str, Divergent], /) -> None) | None`, found `dict[str, Divergent] | dict[Never, Never] | (((dict[str, Divergent], /) -> None) & ~Top[dict[Unknown, Unknown]]) | None`
+ pydantic/fields.py:1575:13 error[invalid-argument-type] Argument is incorrect: Expected `dict[str, Divergent] | ((dict[str, Divergent], /) -> None) | None`, found `dict[str, Divergent] | dict[Never, Never] | Top[TypedDict] | (((dict[str, Divergent], /) -> None) & ~Top[dict[Unknown, Unknown]] & ~Top[TypedDict]) | None`
- pydantic/json_schema.py:1693:13 error[no-matching-overload] No overload of bound method `update` matches arguments

pyjwt (https://github.com/jpadilla/pyjwt)
- jwt/jwks_client.py:145:35 error[invalid-argument-type] Argument to function `from_dict` is incorrect: Expected `dict[str, Any]`, found `(PyJWKSet & Top[dict[Unknown, Unknown]]) | (Any & Top[dict[Unknown, Unknown]])`
+ jwt/jwks_client.py:145:35 error[invalid-argument-type] Argument to function `from_dict` is incorrect: Expected `dict[str, Any]`, found `(PyJWKSet & Top[dict[Unknown, Unknown]]) | (Any & Top[dict[Unknown, Unknown]]) | (Any & Top[TypedDict])`

pyproject-metadata (https://github.com/pypa/pyproject-metadata)
- pyproject_metadata/project_table.py:276:16 error[no-matching-overload] No overload of bound method `fullmatch` matches arguments
- pyproject_metadata/project_table.py:358:51 error[invalid-argument-type] Argument to function `join` is incorrect: Expected `str`, found `object`

schema_salad (https://github.com/common-workflow-language/schema_salad)
- schema_salad/avro/schema.py:802:34 error[invalid-argument-type] Argument to function `is_subtype` is incorrect: Expected `None | str | int | ... omitted 6 union elements`, found `object`
- schema_salad/avro/schema.py:804:44 error[invalid-argument-type] Argument to function `is_subtype` is incorrect: Expected `None | str | int | ... omitted 6 union elements`, found `object`
- schema_salad/avro/schema.py:804:44 error[invalid-argument-type] Method `__getitem__` of type `bound method Top[dict[Unknown, Unknown]].__getitem__(key: Never, /) -> object` cannot be called with key of type `Literal["names"]` on object of type `Top[dict[Unknown, Unknown]]`
- schema_salad/avro/schema.py:806:64 error[invalid-argument-type] Argument to bound method `get` is incorrect: Expected `Never`, found `Literal["name"]`
- schema_salad/avro/schema.py:808:25 error[invalid-argument-type] Argument to bound method `get` is incorrect: Expected `Never`, found `Literal["type"]`
- schema_salad/avro/schema.py:809:57 error[invalid-argument-type] Argument to function `is_subtype` is incorrect: Expected `None | str | int | ... omitted 6 union elements`, found `object`
- schema_salad/avro/schema.py:810:25 error[invalid-argument-type] Argument to bound method `get` is incorrect: Expected `Never`, found `Literal["type"]`
- schema_salad/avro/schema.py:811:38 error[invalid-argument-type] Argument to function `is_subtype` is incorrect: Expected `None | str | int | ... omitted 6 union elements`, found `object`
- schema_salad/avro/schema.py:811:58 error[invalid-argument-type] Argument to function `is_subtype` is incorrect: Expected `None | str | int | ... omitted 6 union elements`, found `object`
- schema_salad/avro/schema.py:812:25 error[invalid-argument-type] Argument to bound method `get` is incorrect: Expected `Never`, found `Literal["type"]`
- schema_salad/avro/schema.py:813:38 error[invalid-argument-type] Argument to function `is_subtype` is incorrect: Expected `None | str | int | ... omitted 6 union elements`, found `object`
- schema_salad/avro/schema.py:813:59 error[invalid-argument-type] Method `__getitem__` of type `bound method Top[dict[Unknown, Unknown]].__getitem__(key: Never, /) -> object` cannot be called with key of type `Literal["symbols"]` on object of type `Top[dict[Unknown, Unknown]]`
- schema_salad/avro/schema.py:814:57 error[invalid-argument-type] Argument to bound method `get` is incorrect: Expected `Never`, found `Literal["type"]`
- schema_salad/avro/schema.py:817:66 error[invalid-argument-type] Method `__getitem__` of type `bound method Top[dict[Unknown, Unknown]].__getitem__(key: Never, /) -> object` cannot be called with key of type `Literal["fields"]` on object of type `Top[dict[Unknown, Unknown]]`

schemathesis (https://github.com/schemathesis/schemathesis)
- src/schemathesis/config/_diff_base.py:44:49 error[invalid-argument-type] Method `__getitem__` of type `bound method Top[dict[Unknown, Unknown]].__getitem__(key: Never, /) -> object` cannot be called with key of type `object` on object of type `Top[dict[Unknown, Unknown]]`
- src/schemathesis/config/_diff_base.py:64:33 error[invalid-argument-type] Argument to bound method `get` is incorrect: Expected `Never`, found `object`
- src/schemathesis/openapi/checks.py:151:31 error[invalid-argument-type] Argument to function `unbundle` is incorrect: Expected `dict[str, Any] | bool | list[dict[str, Any] | bool]`, found `dict[Unknown, Unknown] | (Unresolvable & Top[dict[Unknown, Unknown]]) | bool | dict[str, Any] | dict[object, object]`
+ src/schemathesis/openapi/checks.py:151:31 error[invalid-argument-type] Argument to function `unbundle` is incorrect: Expected `dict[str, Any] | bool | list[dict[str, Any] | bool]`, found `dict[Unknown, Unknown] | (Unresolvable & Top[dict[Unknown, Unknown]]) | bool | dict[str, Any] | dict[Unknown | str, Unknown]`
- src/schemathesis/resources/repository.py:119:32 error[invalid-argument-type] Argument to bound method `append` is incorrect: Expected `dict[str, Any]`, found `Top[dict[Unknown, Unknown]]`
+ src/schemathesis/resources/repository.py:119:32 error[invalid-argument-type] Argument to bound method `append` is incorrect: Expected `dict[str, Any]`, found `Top[dict[Unknown, Unknown]] | Top[TypedDict]`
- src/schemathesis/specs/openapi/adapter/responses.py:398:16 error[invalid-return-type] Return type does not match returned value: expected `str | None`, found `object`
- src/schemathesis/specs/openapi/adapter/responses.py:411:16 error[invalid-return-type] Return type does not match returned value: expected `str | None`, found `object`
- src/schemathesis/specs/openapi/examples.py:745:70 error[unresolved-attribute] Object of type `object` has no attribute `lower`
- src/schemathesis/specs/openapi/examples.py:758:50 error[invalid-argument-type] Argument to function `_find_matching_in_responses` is incorrect: Expected `dict[str, Any]`, found `Top[dict[Unknown, Unknown]]`
+ src/schemathesis/specs/openapi/examples.py:758:50 error[invalid-argument-type] Argument to function `_find_matching_in_responses` is incorrect: Expected `dict[str, Any]`, found `Top[dict[Unknown, Unknown]] | Top[TypedDict]`

scikit-build-core (https://github.com/scikit-build/scikit-build-core)
- src/scikit_build_core/_vendor/pyproject_metadata/project_table.py:276:16 error[no-matching-overload] No overload of bound method `fullmatch` matches arguments
- src/scikit_build_core/_vendor/pyproject_metadata/project_table.py:311:21 error[invalid-argument-type] Method `__getitem__` of type `bound method Top[dict[Unknown, Unknown]].__getitem__(key: Never, /) -> object` cannot be called with key of type `str` on object of type `Top[dict[Unknown, Unknown]]`
- src/scikit_build_core/_vendor/pyproject_metadata/project_table.py:358:51 error[invalid-argument-type] Argument to function `join` is incorrect: Expected `str`, found `object`
- src/scikit_build_core/_vendor/pyproject_metadata/pyproject.py:90:12 error[invalid-return-type] Return type does not match returned value: expected `dict[str, str] | None`, found `Top[dict[Unknown, Unknown]]`
+ src/scikit_build_core/_vendor/pyproject_metadata/pyproject.py:90:12 error[invalid-return-type] Return type does not match returned value: expected `dict[str, str] | None`, found `Top[dict[Unknown, Unknown]] | Top[TypedDict]`
- src/scikit_build_core/metadata/__init__.py:108:51 error[unresolved-attribute] Object of type `object` has no attribute `items`
- src/scikit_build_core/metadata/__init__.py:89:35 error[invalid-argument-type] Argument is incorrect: Expected `str`, found `object`
- src/scikit_build_core/metadata/__init__.py:107:16 error[invalid-return-type] Return type does not match returned value: expected `T@_process_dynamic_metadata`, found `dict[object, dict[str, str]]`
+ src/scikit_build_core/metadata/__init__.py:107:16 error[invalid-return-type] Return type does not match returned value: expected `T@_process_dynamic_metadata`, found `dict[Unknown, dict[str, str]]`
- src/scikit_build_core/metadata/__init__.py:117:16 error[invalid-return-type] Return type does not match returned value: expected `T@_process_dynamic_metadata`, found `dict[object, list[str]]`
+ src/scikit_build_core/metadata/__init__.py:117:16 error[invalid-return-type] Return type does not match returned value: expected `T@_process_dynamic_metadata`, found `dict[Unknown, list[str]]`
- src/scikit_build_core/metadata/__init__.py:117:40 error[not-iterable] Object of type `object` is not iterable

setuptools (https://github.com/pypa/setuptools)
- setuptools/_distutils/command/build_ext.py:430:38 error[invalid-argument-type] Argument to bound method `get` is incorrect: Expected `Never`, found `Literal["include_dirs", "library_dirs", "libraries", "extra_objects", "extra_compile_args", "extra_link_args"]`
- setuptools/_distutils/command/build_ext.py:435:55 error[invalid-argument-type] Argument to bound method `get` is incorrect: Expected `Never`, found `Literal["rpath"]`
- setuptools/_distutils/command/build_ext.py:441:37 error[invalid-argument-type] Argument to bound method `get` is incorrect: Expected `Never`, found `Literal["macros"]`
+ setuptools/_distutils/command/build_ext.py:445:30 error[not-iterable] Object of type `~AlwaysFalsy` is not iterable
- setuptools/_distutils/command/build_ext.py:418:39 error[invalid-argument-type] Method `__getitem__` of type `bound method Top[dict[Unknown, Unknown]].__getitem__(key: Never, /) -> object` cannot be called with key of type `Literal["sources"]` on object of type `Top[dict[Unknown, Unknown]]`

sockeye (https://github.com/awslabs/sockeye)
- sockeye/inference.py:410:32 error[invalid-argument-type] Argument is incorrect: Expected `RestrictLexicon | None`, found `object`

spack (https://github.com/spack/spack)
- lib/spack/spack/vendor/jinja2/filters.py:219:50 error[invalid-assignment] Object of type `dict_items[object, object]` is not assignable to `Iterable[tuple[str, Any]]`

sympy (https://github.com/sympy/sympy)
- sympy/ntheory/tests/test_factor_.py:64:16 error[unsupported-operator] Operator `%` is not supported between objects of type `~AlwaysFalsy & ~Literal[1]` and `Literal[2]`
- sympy/physics/mechanics/lagrange.py:453:23 error[not-iterable] Object of type `(Unknown & ~Top[dict[Unknown, Unknown]]) | None` may not be iterable
+ sympy/physics/mechanics/lagrange.py:453:23 error[not-iterable] Object of type `(Unknown & ~Top[dict[Unknown, Unknown]] & ~Top[TypedDict]) | None` may not be iterable
- sympy/utilities/misc.py:465:24 error[invalid-argument-type] Argument to function `len` is incorrect: Expected `Sized`, found `object`

tornado (https://github.com/tornadoweb/tornado)
- tornado/gen.py:516:47 error[invalid-argument-type] Argument to function `__new__` is incorrect: Expected `Iterable[None | Awaitable[Unknown] | list[Awaitable[Unknown]] | dict[Any, Awaitable[Unknown]] | Future[Unknown]]`, found `dict_values[object, object] | (Sequence[None | Awaitable[Unknown] | list[Awaitable[Unknown]] | dict[Any, Awaitable[Unknown]] | Future[Unknown]] & ~Top[dict[Unknown, Unknown]]) | (Mapping[Any, None | Awaitable[Unknown] | list[Awaitable[Unknown]] | dict[Any, Awaitable[Unknown]] | Future[Unknown]] & ~Top[dict[Unknown, Unknown]])`

urllib3 (https://github.com/urllib3/urllib3)
- src/urllib3/fields.py:281:24 error[invalid-assignment] Object of type `dict_items[object, object]` is not assignable to `Iterable[tuple[str, str | bytes | None]]`

vision (https://github.com/pytorch/vision)
- torchvision/transforms/v2/_utils.py:69:41 error[invalid-argument-type] Argument to function `_convert_fill_arg` is incorrect: Expected `int | float | Sequence[int | float] | None`, found `object`

xarray (https://github.com/pydata/xarray)
- xarray/core/dataarray.py:474:9 error[invalid-assignment] Object of type `(Sequence[Sequence[Unknown] | Index[Any] | DataArray | Variable | ndarray[tuple[Any, ...], dtype[Any]]] & Top[dict[Unknown, Unknown]]) | (Mapping[Unknown, Unknown] & Top[dict[Unknown, Unknown]]) | dict[Unknown, Variable]` is not assignable to attribute `_coords` of type `dict[Any, Variable]`
+ xarray/core/dataarray.py:474:9 error[invalid-assignment] Object of type `(Sequence[Sequence[Unknown] | Index[Any] | DataArray | Variable | ndarray[tuple[Any, ...], dtype[Any]]] & Top[dict[Unknown, Unknown]]) | (Mapping[Unknown, Unknown] & Top[dict[Unknown, Unknown]]) | (Mapping[Unknown, Unknown] & Top[TypedDict]) | dict[Unknown, Variable]` is not assignable to attribute `_coords` of type `dict[Any, Variable]`

xarray-dataclasses (https://github.com/astropenguin/xarray-dataclasses)
- xarray_dataclasses/dataarray.py:187:27 error[invalid-argument-type] Method `__getitem__` of type `Overload[(index: int, /) -> int, (index: slice[int | None, int | None, int | None], /) -> Sequence[int]]` cannot be called with key of type `str` on object of type `Sequence[int]`
- xarray_dataclasses/dataarray.py:187:27 error[invalid-argument-type] Method `__getitem__` of type `bound method Top[dict[Unknown, Unknown]].__getitem__(key: Never, /) -> object` cannot be called with key of type `str` on object of type `Top[dict[Unknown, Unknown]]`

zulip (https://github.com/zulip/zulip)
+ zerver/decorator.py:1063:9 error[invalid-assignment] Cannot assign to a subscript on an object of type `Top[TypedDict]`
- zerver/lib/event_schema.py:385:16 error[invalid-argument-type] Method `__getitem__` of type `bound method Top[dict[Unknown, Unknown]].__getitem__(key: Never, /) -> object` cannot be called with key of type `Literal["services"]` on object of type `Top[dict[Unknown, Unknown]]`
- zerver/lib/push_notifications.py:610:29 error[invalid-argument-type] Method `__getitem__` of type `bound method Top[dict[Unknown, Unknown]].__getitem__(key: Never, /) -> object` cannot be called with key of type `Literal["apple_devices"]` on object of type `Top[dict[Unknown, Unknown]]`
- zerver/lib/push_notifications.py:642:20 error[invalid-argument-type] Method `__getitem__` of type `bound method Top[dict[Unknown, Unknown]].__getitem__(key: Never, /) -> object` cannot be called with key of type `Literal["can_push"]` on object of type `Top[dict[Unknown, Unknown]]`
- zerver/lib/push_notifications.py:650:33 error[invalid-argument-type] Method `__getitem__` of type `bound method Top[dict[Unknown, Unknown]].__getitem__(key: Never, /) -> object` cannot be called with key of type `Literal["expected_end_timestamp"]` on object of type `Top[dict[Unknown, Unknown]]`
- zerver/lib/validator.py:258:34 error[invalid-argument-type] Method `__getitem__` of type `bound method Top[dict[Unknown, Unknown]].__getitem__(key: Never, /) -> object` cannot be called with key of type `str` on object of type `Top[dict[Unknown, Unknown]]`
- zerver/lib/validator.py:269:24 error[invalid-argument-type] Method `__getitem__` of type `bound method Top[dict[Unknown, Unknown]].__getitem__(key: Never, /) -> object` cannot be called with key of type `object` on object of type `Top[dict[Unknown, Unknown]]`
- zerver/lib/validator.py:277:67 error[no-matching-overload] No overload of bound method `join` matches arguments
- zerver/lib/validator.py:434:19 error[invalid-argument-type] Method `__getitem__` of type `bound method Top[dict[Unknown, Unknown]].__getitem__(key: Never, /) -> object` cannot be called with key of type `Literal["widget_type"]` on object of type `Top[dict[Unknown, Unknown]]`
- zerver/lib/validator.py:444:12 error[invalid-argument-type] Method `__getitem__` of type `bound method Top[dict[Unknown, Unknown]].__getitem__(key: Never, /) -> object` cannot be called with key of type `Literal["type"]` on object of type `Top[dict[Unknown, Unknown]]`
- zerver/lib/validator.py:483:8 error[invalid-argument-type] Method `__getitem__` of type `bound method Top[dict[Unknown, Unknown]].__getitem__(key: Never, /) -> object` cannot be called with key of type `Literal["type"]` on object of type `Top[dict[Unknown, Unknown]]`
- zerver/lib/validator.py:494:8 error[invalid-argument-type] Method `__getitem__` of type `bound method Top[dict[Unknown, Unknown]].__getitem__(key: Never, /) -> object` cannot be called with key of type `Literal["type"]` on object of type `Top[dict[Unknown, Unknown]]`
- zerver/lib/validator.py:507:8 error[invalid-argument-type] Method `__getitem__` of type `bound method Top[dict[Unknown, Unknown]].__getitem__(key: Never, /) -> object` cannot be called with key of type `Literal["type"]` on object of type `Top[dict[Unknown, Unknown]]`
- zerver/lib/validator.py:518:58 error[invalid-argument-type] Method `__getitem__` of type `bound method Top[dict[Unknown, Unknown]].__getitem__(key: Never, /) -> object` cannot be called with key of type `Literal["type"]` on object of type `Top[dict[Unknown, Unknown]]`
- zerver/lib/validator.py:526:8 error[invalid-argument-type] Method `__getitem__` of type `bound method Top[dict[Unknown, Unknown]].__getitem__(key: Never, /) -> object` cannot be called with key of type `Literal["type"]` on object of type `Top[dict[Unknown, Unknown]]`
- zerver/lib/validator.py:549:8 error[invalid-argument-type] Method `__getitem__` of type `bound method Top[dict[Unknown, Unknown]].__getitem__(key: Never, /) -> object` cannot be called with key of type `Literal["type"]` on object of type `Top[dict[Unknown, Unknown]]`
- zerver/lib/validator.py:469:56 error[invalid-argument-type] Method `__getitem__` of type `bound method Top[dict[Unknown, Unknown]].__getitem__(key: Never, /) -> object` cannot be called with key of type `Literal["type"]` on object of type `Top[dict[Unknown, Unknown]]`
- zerver/openapi/openapi.py:50:47 error[invalid-argument-type] Argument to function `naively_merge` is incorrect: Expected `dict[str, object]`, found `Top[dict[Unknown, Unknown]]`
+ zerver/openapi/openapi.py:50:47 error[invalid-argument-type] Argument to function `naively_merge` is incorrect: Expected `dict[str, object]`, found `Top[dict[Unknown, Unknown]] | Top[TypedDict]`
- zerver/openapi/openapi.py:71:63 error[invalid-argument-type] Argument to function `naively_merge_allOf_dict` is incorrect: Expected `dict[str, object]`, found `Top[dict[Unknown, Unknown]]`
+ zerver/openapi/openapi.py:71:63 error[invalid-argument-type] Argument to function `naively_merge_allOf_dict` is incorrect: Expected `dict[str, object]`, found `Top[dict[Unknown, Unknown]] | Top[TypedDict]`

Full report with detailed diff (timing results)

@charliermarsh charliermarsh force-pushed the charlie/td-narrow branch 6 times, most recently from 6490850 to f2f91f3 Compare March 17, 2026 00:06
@charliermarsh charliermarsh changed the base branch from charlie/td-narrow-split2 to charlie/td-specialize-2 March 27, 2026 01:26
@charliermarsh charliermarsh force-pushed the charlie/td-specialize-2 branch 3 times, most recently from 47d3fc6 to aa5ab5e Compare March 28, 2026 00:15
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.

isinstance(..., dict) and top materialization result in false positive on .get() call Account for TypedDicts in narrowing of isinstance(..., dict)

3 participants