Skip to content

[ty] Support calls to intersection types#22469

Open
carljm wants to merge 43 commits intomainfrom
claude/fix-issue-1858-UjARA
Open

[ty] Support calls to intersection types#22469
carljm wants to merge 43 commits intomainfrom
claude/fix-issue-1858-UjARA

Conversation

@carljm
Copy link
Contributor

@carljm carljm commented Jan 9, 2026

Fixes astral-sh/ty#1858

Handle calls to intersection types. Previously, calling an intersection type would return a @Todo type that suppressed errors but provided no useful type information.

Now, when calling an intersection type:

  • We check each positive element of the intersection for callability
  • If at least one element can be called successfully with the given arguments, the intersection can be
  • The return type is the intersection of the return types from all successfully-called elements (plus any top-callable elements; these error when called because the arguments can't be correct for all members of the top-callable type -- but we know that some member of the top-callable type would match those arguments, so it's correct to still include the return type of the top-callable)
  • If no elements are callable, the "highest priority" errors from failed elements are reported
  • More specific errors are higher priority to report; for example if one intersection element is not callable at all, and the other is callable but the arguments were wrong, we report only the wrong arguments

Ecosystem review only revealed existing known issues or correct behaviors newly exposed by actually processing intersection calls and getting precise return types instead of Todo types

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

astral-sh-bot bot commented Jan 9, 2026

Typing conformance results

No changes detected ✅

@astral-sh-bot
Copy link

astral-sh-bot bot commented Jan 9, 2026

mypy_primer results

Changes were detected when running on open source projects
mypy_primer (https://github.com/hauntsaninja/mypy_primer)
+ mypy_primer/git_utils.py:65:23: error[call-top-callable] Object of type `Top[(...) -> object]` is not safe to call; its signature is not known
- Found 3 diagnostics
+ Found 4 diagnostics

attrs (https://github.com/python-attrs/attrs)
- tests/test_make.py:2878:16: error[unsupported-operator] Operator `<` is not supported between two objects of type `C | @Todo`
+ tests/test_make.py:2878:16: error[unsupported-operator] Operator `<` is not supported between two objects of type `C | Any`
- tests/test_make.py:2883:16: error[unsupported-operator] Operator `>` is not supported between two objects of type `C | @Todo`
+ tests/test_make.py:2883:16: error[unsupported-operator] Operator `>` is not supported between two objects of type `C | Any`

aioredis (https://github.com/aio-libs/aioredis)
+ aioredis/connection.py:206:20: error[call-non-callable] Object of type `Mapping[str, type[Exception]]` is not callable
- aioredis/connection.py:206:20: error[invalid-return-type] Return type does not match returned value: expected `ResponseError`, found `Exception | @Todo`
+ aioredis/connection.py:206:20: error[invalid-return-type] Return type does not match returned value: expected `ResponseError`, found `Exception | Unknown`
- Found 29 diagnostics
+ Found 30 diagnostics

pip (https://github.com/pypa/pip)
+ src/pip/_vendor/cachecontrol/controller.py:349:12: error[unresolved-attribute] Object of type `~None` has no attribute `status`
+ src/pip/_vendor/cachecontrol/controller.py:351:45: error[unresolved-attribute] Object of type `~None` has no attribute `status`
+ src/pip/_vendor/cachecontrol/controller.py:356:13: error[unresolved-attribute] Object of type `~None` has no attribute `headers`
+ src/pip/_vendor/cachecontrol/controller.py:420:49: error[invalid-argument-type] Argument to bound method `_cache_set` is incorrect: Expected `HTTPResponse`, found `~None`
+ src/pip/_vendor/cachecontrol/controller.py:424:18: error[unresolved-attribute] Object of type `~None` has no attribute `status`
+ src/pip/_vendor/cachecontrol/controller.py:426:49: error[invalid-argument-type] Argument to bound method `_cache_set` is incorrect: Expected `HTTPResponse`, found `~None`
+ src/pip/_vendor/cachecontrol/controller.py:443:21: error[invalid-argument-type] Argument to bound method `_cache_set` is incorrect: Expected `HTTPResponse`, found `~None`
+ src/pip/_vendor/cachecontrol/controller.py:466:25: error[invalid-argument-type] Argument to bound method `_cache_set` is incorrect: Expected `HTTPResponse`, found `~None`
+ src/pip/_vendor/rich/_log_render.py:60:36: error[call-top-callable] Object of type `Top[(...) -> object]` is not safe to call; its signature is not known
+ src/pip/_vendor/rich/text.py:622:31: error[call-top-callable] Object of type `Top[(...) -> object]` is not safe to call; its signature is not known
+ src/pip/_vendor/rich/text.py:622:31: error[call-top-callable] Object of type `Top[(...) -> object]` is not safe to call; its signature is not known
- Found 619 diagnostics
+ Found 630 diagnostics

werkzeug (https://github.com/pallets/werkzeug)
+ src/werkzeug/middleware/profiler.py:135:28: error[call-top-callable] Object of type `Top[(...) -> object]` is not safe to call; its signature is not known
+ src/werkzeug/utils.py:515:19: error[call-top-callable] Object of type `Top[(...) -> object]` is not safe to call; its signature is not known
- Found 387 diagnostics
+ Found 389 diagnostics

beartype (https://github.com/beartype/beartype)
- beartype/_decor/_nontype/decornontype.py:156:59: warning[unused-type-ignore-comment] Unused blanket `type: ignore` directive
- beartype/_decor/_nontype/decornontype.py:215:63: warning[unused-type-ignore-comment] Unused blanket `type: ignore` directive
+ beartype/vale/_core/_valecore.py:322:30: error[call-top-callable] Object of type `Top[(...) -> object]` is not safe to call; its signature is not known
- Found 515 diagnostics
+ Found 514 diagnostics

websockets (https://github.com/aaugustin/websockets)
+ src/websockets/legacy/server.py:632:29: error[call-top-callable] Object of type `Top[(...) -> object]` is not safe to call; its signature is not known
+ src/websockets/legacy/server.py:632:29: error[call-top-callable] Object of type `Top[(...) -> object]` is not safe to call; its signature is not known
+ src/websockets/legacy/server.py:632:29: error[call-top-callable] Object of type `Top[(...) -> object]` is not safe to call; its signature is not known
- Found 41 diagnostics
+ Found 44 diagnostics

spack (https://github.com/spack/spack)
- lib/spack/spack/detection/path.py:169:33: error[invalid-argument-type] Argument to function `dedupe_paths` is incorrect: Expected `list[str]`, found `Unknown | list[int | str | bytes | ... omitted 3 union elements]`
+ lib/spack/spack/detection/path.py:169:33: error[invalid-argument-type] Argument to function `dedupe_paths` is incorrect: Expected `list[str]`, found `Unknown | list[Unknown | int | str | ... omitted 3 union elements]`
+ lib/spack/spack/directives.py:406:13: error[call-top-callable] Object of type `Top[(...) -> object]` is not safe to call; its signature is not known
+ lib/spack/spack/llnl/util/lock.py:735:24: error[call-non-callable] Object of type `ContextManager[Unknown]` is not callable
- lib/spack/spack/vendor/ruamel/yaml/main.py:1071:16: error[unresolved-attribute] Attribute `_constructor` is not defined on `Loader` in union `@Todo | Loader`
+ lib/spack/spack/vendor/ruamel/yaml/main.py:1071:16: error[unresolved-attribute] Attribute `_constructor` is not defined on `Loader` in union `Unknown | Loader`
- lib/spack/spack/vendor/ruamel/yaml/main.py:1096:15: error[unresolved-attribute] Attribute `_constructor` is not defined on `Loader` in union `@Todo | Loader`
+ lib/spack/spack/vendor/ruamel/yaml/main.py:1096:15: error[unresolved-attribute] Attribute `_constructor` is not defined on `Loader` in union `Unknown | Loader`
- lib/spack/spack/vendor/ruamel/yaml/main.py:1097:19: error[unresolved-attribute] Attribute `_constructor` is not defined on `Loader` in union `@Todo | Loader`
+ lib/spack/spack/vendor/ruamel/yaml/main.py:1097:19: error[unresolved-attribute] Attribute `_constructor` is not defined on `Loader` in union `Unknown | Loader`
- lib/spack/spack/vendor/ruamel/yaml/main.py:1099:9: error[unresolved-attribute] Attribute `_parser` is not defined on `Loader` in union `@Todo | Loader`
+ lib/spack/spack/vendor/ruamel/yaml/main.py:1099:9: error[unresolved-attribute] Attribute `_parser` is not defined on `Loader` in union `Unknown | Loader`
- lib/spack/spack/vendor/ruamel/yaml/main.py:1101:13: error[unresolved-attribute] Attribute `_reader` is not defined on `Loader` in union `@Todo | Loader`
+ lib/spack/spack/vendor/ruamel/yaml/main.py:1101:13: error[unresolved-attribute] Attribute `_reader` is not defined on `Loader` in union `Unknown | Loader`
- lib/spack/spack/vendor/ruamel/yaml/main.py:1105:13: error[unresolved-attribute] Attribute `_scanner` is not defined on `Loader` in union `@Todo | Loader`
+ lib/spack/spack/vendor/ruamel/yaml/main.py:1105:13: error[unresolved-attribute] Attribute `_scanner` is not defined on `Loader` in union `Unknown | Loader`
- Found 4382 diagnostics
+ Found 4384 diagnostics

graphql-core (https://github.com/graphql-python/graphql-core)
- src/graphql/language/visitor.py:266:34: error[invalid-argument-type] Argument to bound method `append` is incorrect: Expected `tuple[int | str, Node]`, found `tuple[None | Any | int | Node, @Todo & ~Literal[VisitorActionEnum.BREAK] & ~Literal[True] & ~Literal[VisitorActionEnum.SKIP] & ~Literal[False] & ~None]`
+ src/graphql/language/visitor.py:266:34: error[invalid-argument-type] Argument to bound method `append` is incorrect: Expected `tuple[int | str, Node]`, found `tuple[None | Any | int | Node, Literal[VisitorActionEnum.REMOVE]]`
+ src/graphql/type/definition.py:302:12: error[call-top-callable] Object of type `Top[(...) -> object]` is not safe to call; its signature is not known
- Found 638 diagnostics
+ Found 639 diagnostics

scrapy (https://github.com/scrapy/scrapy)
+ scrapy/downloadermiddlewares/retry.py:110:22: error[call-top-callable] Object of type `Top[(...) -> object]` is not safe to call; its signature is not known
+ scrapy/downloadermiddlewares/retry.py:110:22: error[call-top-callable] Object of type `Top[(...) -> object]` is not safe to call; its signature is not known
- Found 1774 diagnostics
+ Found 1776 diagnostics

starlette (https://github.com/encode/starlette)
+ starlette/_exception_handler.py:59:42: error[invalid-argument-type] Argument is incorrect: Expected `Request[State]`, found `Request[State] | WebSocket[State]`
- starlette/middleware/errors.py:181:23: error[call-non-callable] Object of type `None` is not callable

pytest (https://github.com/pytest-dev/pytest)
+ src/_pytest/python.py:475:28: error[call-non-callable] Object of type `Class` is not callable
+ src/_pytest/python.py:475:28: error[call-non-callable] Object of type `<Protocol with members 'pytest_generate_tests'>` is not callable
- Found 390 diagnostics
+ Found 392 diagnostics

paasta (https://github.com/yelp/paasta)
+ paasta_tools/async_utils.py:168:21: error[call-top-callable] Object of type `Top[(...) -> object]` is not safe to call; its signature is not known
- Found 1063 diagnostics
+ Found 1064 diagnostics

ignite (https://github.com/pytorch/ignite)
+ ignite/handlers/base_logger.py:48:20: error[call-top-callable] Object of type `Top[(...) -> object]` is not safe to call; its signature is not known
- Found 2140 diagnostics
+ Found 2141 diagnostics

kopf (https://github.com/nolar/kopf)
+ kopf/_core/engines/daemons.py:471:17: error[call-top-callable] Object of type `Top[(...) -> object]` is not safe to call; its signature is not known
+ kopf/_core/engines/daemons.py:471:17: error[call-top-callable] Object of type `Top[(...) -> object]` is not safe to call; its signature is not known
+ kopf/_core/engines/daemons.py:541:17: error[call-top-callable] Object of type `Top[(...) -> object]` is not safe to call; its signature is not known
+ kopf/_core/engines/daemons.py:541:17: error[call-top-callable] Object of type `Top[(...) -> object]` is not safe to call; its signature is not known
+ kopf/_core/intents/registries.py:485:16: error[call-top-callable] Object of type `Top[(...) -> object]` is not safe to call; its signature is not known
- Found 290 diagnostics
+ Found 295 diagnostics

pylint (https://github.com/pycqa/pylint)
- pylint/checkers/refactoring/implicit_booleaness_checker.py:219:24: error[unresolved-attribute] Attribute `as_string` is not defined on `str` in union `str | Unknown`
+ pylint/checkers/refactoring/implicit_booleaness_checker.py:219:24: error[unresolved-attribute] Attribute `as_string` is not defined on `str` in union `Unknown | str`
- pylint/checkers/refactoring/implicit_booleaness_checker.py:219:62: error[unresolved-attribute] Attribute `as_string` is not defined on `str` in union `str | Unknown`
+ pylint/checkers/refactoring/implicit_booleaness_checker.py:219:62: error[unresolved-attribute] Attribute `as_string` is not defined on `str` in union `Unknown | str`
- pylint/checkers/refactoring/implicit_booleaness_checker.py:222:27: error[unresolved-attribute] Attribute `as_string` is not defined on `str` in union `str | (Unknown & ~None)`
+ pylint/checkers/refactoring/implicit_booleaness_checker.py:222:27: error[unresolved-attribute] Attribute `as_string` is not defined on `str` in union `(Unknown & ~None) | str`
- pylint/checkers/refactoring/implicit_booleaness_checker.py:236:29: error[unresolved-attribute] Attribute `as_string` is not defined on `str` in union `str | Unknown`
+ pylint/checkers/refactoring/implicit_booleaness_checker.py:236:29: error[unresolved-attribute] Attribute `as_string` is not defined on `str` in union `Unknown | str`
- pylint/checkers/refactoring/implicit_booleaness_checker.py:239:29: error[unresolved-attribute] Attribute `as_string` is not defined on `str` in union `str | Unknown`
+ pylint/checkers/refactoring/implicit_booleaness_checker.py:239:29: error[unresolved-attribute] Attribute `as_string` is not defined on `str` in union `Unknown | str`

rich (https://github.com/Textualize/rich)
+ rich/_log_render.py:60:36: error[call-top-callable] Object of type `Top[(...) -> object]` is not safe to call; its signature is not known
+ rich/text.py:622:31: error[call-top-callable] Object of type `Top[(...) -> object]` is not safe to call; its signature is not known
+ rich/text.py:622:31: error[call-top-callable] Object of type `Top[(...) -> object]` is not safe to call; its signature is not known
- tests/test_tools.py:17:17: error[invalid-argument-type] Argument to function `next` is incorrect: Expected `SupportsNext[Unknown]`, found `Iterable[tuple[bool, Unknown | str]]`
+ tests/test_tools.py:17:17: error[invalid-argument-type] Argument to function `next` is incorrect: Expected `SupportsNext[Unknown]`, found `Iterable[tuple[bool, str | Unknown]]`
- tests/test_tools.py:18:17: error[invalid-argument-type] Argument to function `next` is incorrect: Expected `SupportsNext[Unknown]`, found `Iterable[tuple[bool, Unknown | str]]`
+ tests/test_tools.py:18:17: error[invalid-argument-type] Argument to function `next` is incorrect: Expected `SupportsNext[Unknown]`, found `Iterable[tuple[bool, str | Unknown]]`
- tests/test_tools.py:19:17: error[invalid-argument-type] Argument to function `next` is incorrect: Expected `SupportsNext[Unknown]`, found `Iterable[tuple[bool, Unknown | str]]`
+ tests/test_tools.py:19:17: error[invalid-argument-type] Argument to function `next` is incorrect: Expected `SupportsNext[Unknown]`, found `Iterable[tuple[bool, str | Unknown]]`
- tests/test_tools.py:20:17: error[invalid-argument-type] Argument to function `next` is incorrect: Expected `SupportsNext[Unknown]`, found `Iterable[tuple[bool, Unknown | str]]`
+ tests/test_tools.py:20:17: error[invalid-argument-type] Argument to function `next` is incorrect: Expected `SupportsNext[Unknown]`, found `Iterable[tuple[bool, str | Unknown]]`
- Found 351 diagnostics
+ Found 354 diagnostics

porcupine (https://github.com/Akuli/porcupine)
- porcupine/pluginmanager.py:133:49: error[invalid-argument-type] Argument to function `__new__` is incorrect: Expected `Iterable[Never]`, found `Unknown | str`
- Found 25 diagnostics
+ Found 24 diagnostics

dulwich (https://github.com/dulwich/dulwich)
- dulwich/object_store.py:2922:12: error[unsupported-operator] Operator `in` is not supported between objects of type `ObjectID` and `Unknown | ((() -> dict[ObjectID, ObjectID]) & ~AlwaysTruthy & ~AlwaysFalsy) | dict[Unknown, Unknown]`
+ dulwich/object_store.py:2922:12: error[unsupported-operator] Operator `in` is not supported between objects of type `ObjectID` and `Unknown | ((() -> dict[ObjectID, ObjectID]) & ~AlwaysTruthy & ~AlwaysFalsy) | (dict[ObjectID, ObjectID] & ~AlwaysFalsy) | dict[Unknown, Unknown]`
- dulwich/pack.py:2324:78: warning[unused-type-ignore-comment] Unused blanket `type: ignore` directive
+ dulwich/pack.py:3587:13: error[call-top-callable] Object of type `Top[(...) -> object]` is not safe to call; its signature is not known
+ dulwich/repo.py:2707:23: error[call-top-callable] Object of type `Top[(...) -> object]` is not safe to call; its signature is not known
+ dulwich/worktree.py:570:23: error[call-top-callable] Object of type `Top[(...) -> object]` is not safe to call; its signature is not known
+ dulwich/worktree.py:570:23: error[call-top-callable] Object of type `Top[(...) -> object]` is not safe to call; its signature is not known
- Found 222 diagnostics
+ Found 225 diagnostics

PyGithub (https://github.com/PyGithub/PyGithub)
+ github/Auth.py:199:27: error[call-top-callable] Object of type `Top[(...) -> object]` is not safe to call; its signature is not known
- github/MainClass.py:999:80: warning[unused-type-ignore-comment] Unused blanket `type: ignore` directive
- github/Requester.py:899:57: error[invalid-argument-type] Argument to bound method `__hostnameHasDomain` is incorrect: Expected `str | list[str]`, found `Unknown | list[Unknown | str] | list[None | Unknown | str]`
+ github/Requester.py:899:57: error[invalid-argument-type] Argument to bound method `__hostnameHasDomain` is incorrect: Expected `str | list[str]`, found `Unknown | list[Unknown | str] | list[str | Unknown | None]`

nox (https://github.com/wntrblm/nox)
+ nox/_option_set.py:162:20: error[call-top-callable] Object of type `Top[(...) -> object]` is not safe to call; its signature is not known
+ nox/_option_set.py:162:20: error[call-top-callable] Object of type `Top[(...) -> object]` is not safe to call; its signature is not known
- Found 21 diagnostics
+ Found 23 diagnostics

poetry (https://github.com/python-poetry/poetry)
+ src/poetry/utils/cache.py:147:21: error[call-top-callable] Object of type `Top[(...) -> object]` is not safe to call; its signature is not known
- Found 986 diagnostics
+ Found 987 diagnostics

schemathesis (https://github.com/schemathesis/schemathesis)
+ src/schemathesis/core/marks.py:34:20: error[call-top-callable] Object of type `Top[(...) -> object]` is not safe to call; its signature is not known
- Found 318 diagnostics
+ Found 319 diagnostics

artigraph (https://github.com/artigraph/artigraph)
+ src/arti/types/bigquery.py:102:13: error[unknown-argument] Argument `description` does not match any known parameter
+ src/arti/types/bigquery.py:102:44: error[unknown-argument] Argument `nullable` does not match any known parameter
+ src/arti/types/bigquery.py:102:72: error[unknown-argument] Argument `precision` does not match any known parameter
+ src/arti/types/pyarrow.py:292:30: error[invalid-argument-type] Argument is incorrect: Expected `Literal["second", "millisecond", "microsecond", "nanosecond"]`, found `str`
+ src/arti/types/pyarrow.py:292:30: error[unknown-argument] Argument `precision` does not match any known parameter
+ src/arti/types/python.py:69:16: error[invalid-return-type] Return type does not match returned value: expected `Type`, found `_ContainerMixin`
- Found 149 diagnostics
+ Found 155 diagnostics

tornado (https://github.com/tornadoweb/tornado)
+ tornado/escape.py:352:28: error[call-top-callable] Object of type `Top[(...) -> object]` is not safe to call; its signature is not known
+ tornado/tcpclient.py:258:27: error[invalid-assignment] Object of type `_ComplexLike` is not assignable to `int | float | timedelta | None`
- Found 323 diagnostics
+ Found 325 diagnostics

pandera (https://github.com/pandera-dev/pandera)
- pandera/engines/numpy_engine.py:64:38: warning[unused-type-ignore-comment] Unused blanket `type: ignore` directive
- Found 1634 diagnostics
+ Found 1633 diagnostics

pydantic (https://github.com/pydantic/pydantic)
- pydantic/_internal/_validators.py:65:36: warning[unused-type-ignore-comment] Unused blanket `type: ignore` directive
- pydantic/json_schema.py:551:44: warning[unused-type-ignore-comment] Unused blanket `type: ignore` directive
- Found 3204 diagnostics
+ Found 3202 diagnostics

psycopg (https://github.com/psycopg/psycopg)
+ psycopg_pool/psycopg_pool/pool.py:652:20: error[call-top-callable] Object of type `Top[(...) -> object]` is not safe to call; its signature is not known
+ psycopg_pool/psycopg_pool/pool.py:662:20: error[call-top-callable] Object of type `Top[(...) -> object]` is not safe to call; its signature is not known
- Found 655 diagnostics
+ Found 657 diagnostics

koda-validate (https://github.com/keithasaurus/koda-validate)
+ koda_validate/_internal.py:129:23: error[unresolved-attribute] Attribute `val` is not defined on `Nothing` in union `Unknown | Just[SuccessT@_ToTupleStandardValidator] | Nothing`
+ koda_validate/_internal.py:157:23: error[unresolved-attribute] Attribute `val` is not defined on `Nothing` in union `Unknown | Just[SuccessT@_ToTupleStandardValidator] | Nothing`
+ koda_validate/_internal.py:220:30: error[unresolved-attribute] Attribute `val` is not defined on `Invalid` in union `Valid[Any] | Invalid`
+ koda_validate/_internal.py:254:30: error[unresolved-attribute] Attribute `val` is not defined on `Invalid` in union `Valid[A@_wrap_sync_validator] | Invalid`
+ koda_validate/_internal.py:256:24: error[invalid-return-type] Return type does not match returned value: expected `tuple[Literal[True], A@_wrap_sync_validator] | tuple[Literal[False], Invalid]`, found `tuple[Literal[False], Valid[A@_wrap_sync_validator] | Invalid]`
+ koda_validate/dataclasses.py:173:47: error[unresolved-attribute] Attribute `val` is not defined on `Nothing` in union `Unknown | Just[dict[Any, Any]] | Nothing`
+ koda_validate/dataclasses.py:224:47: error[unresolved-attribute] Attribute `val` is not defined on `Nothing` in union `Unknown | Just[dict[Any, Any]] | Nothing`
+ koda_validate/dictionary.py:113:47: error[unresolved-attribute] Attribute `val` is not defined on `Nothing` in union `Unknown | Just[dict[Any, Any]] | Nothing`
+ koda_validate/dictionary.py:169:47: error[unresolved-attribute] Attribute `val` is not defined on `Nothing` in union `Unknown | Just[dict[Any, Any]] | Nothing`
+ koda_validate/list.py:48:42: error[unresolved-attribute] Attribute `val` is not defined on `Nothing` in union `Unknown | Just[list[Any]] | Nothing`
+ koda_validate/list.py:85:42: error[unresolved-attribute] Attribute `val` is not defined on `Nothing` in union `Unknown | Just[list[Any]] | Nothing`
+ koda_validate/namedtuple.py:166:47: error[unresolved-attribute] Attribute `val` is not defined on `Nothing` in union `Unknown | Just[dict[Any, Any]] | Nothing`
+ koda_validate/namedtuple.py:217:47: error[unresolved-attribute] Attribute `val` is not defined on `Nothing` in union `Unknown | Just[dict[Any, Any]] | Nothing`
+ koda_validate/set.py:45:41: error[unresolved-attribute] Attribute `val` is not defined on `Nothing` in union `Unknown | Just[set[Any]] | Nothing`
+ koda_validate/set.py:88:41: error[unresolved-attribute] Attribute `val` is not defined on `Nothing` in union `Unknown | Just[set[Any]] | Nothing`
+ koda_validate/signature.py:299:29: error[invalid-assignment] Invalid subscript assignment with key of type `str` and value of type `Valid[Any] | Invalid` on object of type `dict[str, Invalid]`
+ koda_validate/signature.py:301:50: error[unresolved-attribute] Attribute `val` is not defined on `Invalid` in union `Valid[Any] | Invalid`
+ koda_validate/signature.py:304:46: error[unresolved-attribute] Attribute `val` is not defined on `Invalid` in union `Valid[Any] | Invalid`
+ koda_validate/signature.py:306:25: error[invalid-assignment] Invalid subscript assignment with key of type `str` and value of type `Valid[Any] | Invalid` on object of type `dict[str, Invalid]`
+ koda_validate/signature.py:315:46: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `Invalid`, found `Valid[Any] | Invalid`
+ koda_validate/tuple.py:294:48: error[unresolved-attribute] Attribute `val` is not defined on `Nothing` in union `Unknown | Just[tuple[Any, ...]] | Nothing`
+ koda_validate/tuple.py:335:48: error[unresolved-attribute] Attribute `val` is not defined on `Nothing` in union `Unknown | Just[tuple[Any, ...]] | Nothing`
+ koda_validate/tuple.py:415:48: error[unresolved-attribute] Attribute `val` is not defined on `Nothing` in union `Unknown | Just[tuple[Any, ...]] | Nothing`
+ koda_validate/tuple.py:459:48: error[unresolved-attribute] Attribute `val` is not defined on `Nothing` in union `Unknown | Just[tuple[Any, ...]] | Nothing`
+ koda_validate/typeddict.py:167:47: error[unresolved-attribute] Attribute `val` is not defined on `Nothing` in union `Unknown | Just[dict[Any, Any]] | Nothing`
+ koda_validate/typeddict.py:209:47: error[unresolved-attribute] Attribute `val` is not defined on `Nothing` in union `Unknown | Just[dict[Any, Any]] | Nothing`
- Found 397 diagnostics
+ Found 423 diagnostics

vision (https://github.com/pytorch/vision)
+ test/datasets_utils.py:835:57: error[call-top-callable] Object of type `Top[(...) -> object]` is not safe to call; its signature is not known
+ test/datasets_utils.py:835:57: error[call-top-callable] Object of type `Top[(...) -> object]` is not safe to call; its signature is not known
+ test/datasets_utils.py:956:57: error[call-top-callable] Object of type `Top[(...) -> object]` is not safe to call; its signature is not known
+ test/datasets_utils.py:956:57: error[call-top-callable] Object of type `Top[(...) -> object]` is not safe to call; its signature is not known
+ torchvision/models/_utils.py:201:43: error[call-top-callable] Object of type `Top[(...) -> object]` is not safe to call; its signature is not known
- Found 1438 diagnostics
+ Found 1443 diagnostics

cloud-init (https://github.com/canonical/cloud-init)
- tests/unittests/distros/test_user_data_normalize.py:24:31: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `dict[Unknown, Unknown]`, found `Unknown | dict[Unknown | str, Unknown | str] | str | ... omitted 3 union elements`
+ tests/unittests/distros/test_user_data_normalize.py:24:31: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `dict[Unknown, Unknown]`, found `Unknown | bool | list[Unknown] | ... omitted 3 union elements`
- tests/unittests/sources/test_gce.py:71:31: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `dict[Unknown, Unknown]`, found `Unknown | dict[Unknown | str, Unknown | str] | str | ... omitted 3 union elements`
+ tests/unittests/sources/test_gce.py:71:31: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `dict[Unknown, Unknown]`, found `Unknown | bool | list[Unknown] | ... omitted 3 union elements`

openlibrary (https://github.com/internetarchive/openlibrary)
+ openlibrary/core/cache.py:487:23: error[call-top-callable] Object of type `Top[(...) -> object]` is not safe to call; its signature is not known
+ openlibrary/core/cache.py:504:23: error[call-top-callable] Object of type `Top[(...) -> object]` is not safe to call; its signature is not known
+ openlibrary/plugins/worksearch/code.py:273:34: error[call-top-callable] Object of type `Top[(...) -> object]` is not safe to call; its signature is not known
+ openlibrary/plugins/worksearch/schemes/__init__.py:75:33: error[call-top-callable] Object of type `Top[(...) -> object]` is not safe to call; its signature is not known
+ openlibrary/plugins/worksearch/schemes/__init__.py:81:24: error[call-top-callable] Object of type `Top[(...) -> object]` is not safe to call; its signature is not known
- Found 1140 diagnostics
+ Found 1145 diagnostics

freqtrade (https://github.com/freqtrade/freqtrade)
+ freqtrade/strategy/informative_decorator.py:157:49: error[call-top-callable] Object of type `Top[(...) -> object]` is not safe to call; its signature is not known
+ freqtrade/strategy/informative_decorator.py:157:49: error[missing-argument] No argument provided for required parameter 1
+ freqtrade/strategy/informative_decorator.py:157:59: error[unknown-argument] Argument `column` does not match any known parameter
+ freqtrade/strategy/informative_decorator.py:159:19: error[call-top-callable] Object of type `Top[(...) -> object]` is not safe to call; its signature is not known
+ freqtrade/strategy/informative_decorator.py:159:19: error[missing-argument] No argument provided for required parameter 1
+ freqtrade/strategy/informative_decorator.py:159:29: error[unknown-argument] Argument `column` does not match any known parameter
- Found 655 diagnostics
+ Found 661 diagnostics

meson (https://github.com/mesonbuild/meson)
+ mesonbuild/compilers/compilers.py:1486:26: error[call-top-callable] Object of type `Top[(...) -> object]` is not safe to call; its signature is not known
+ mesonbuild/compilers/compilers.py:1486:26: error[call-top-callable] Object of type `Top[(...) -> object]` is not safe to call; its signature is not known
+ mesonbuild/compilers/d.py:540:30: error[call-top-callable] Object of type `Top[(...) -> object]` is not safe to call; its signature is not known
+ mesonbuild/compilers/mixins/clike.py:368:40: error[call-top-callable] Object of type `Top[(...) -> object]` is not safe to call; its signature is not known
+ mesonbuild/compilers/vala.py:183:26: error[call-top-callable] Object of type `Top[(...) -> object]` is not safe to call; its signature is not known
+ mesonbuild/compilers/vala.py:183:26: error[call-top-callable] Object of type `Top[(...) -> object]` is not safe to call; its signature is not known
- mesonbuild/dependencies/detect.py:190:16: error[invalid-return-type] Return type does not match returned value: expected `list[DependencyCandidate[ExternalDependency]]`, found `list[Unknown | DependencyCandidate[Unknown]] | list[Unknown | (((Environment, DependencyObjectKWs, /) -> list[DependencyCandidate[ExternalDependency]]) & DependencyCandidate[object] & ~type) | (DependencyCandidate[Unknown] & ~type)] | @Todo`
+ mesonbuild/dependencies/detect.py:190:16: error[invalid-return-type] Return type does not match returned value: expected `list[DependencyCandidate[ExternalDependency]]`, found `list[Unknown | DependencyCandidate[Unknown]] | list[Unknown | (((Environment, DependencyObjectKWs, /) -> list[DependencyCandidate[ExternalDependency]]) & DependencyCandidate[object] & ~type) | (DependencyCandidate[Unknown] & ~type)] | list[DependencyCandidate[ExternalDependency]]`
+ mesonbuild/interpreter/interpreterobjects.py:928:16: error[invalid-return-type] Return type does not match returned value: expected `str | int | Sequence[Divergent] | ... omitted 5 union elements`, found `Unknown | str | int | ... omitted 7 union elements`
- Found 2206 diagnostics
+ Found 2213 diagnostics

strawberry (https://github.com/strawberry-graphql/strawberry)
+ strawberry/types/fields/resolver.py:250:16: error[call-top-callable] Object of type `Top[(...) -> object]` is not safe to call; its signature is not known
- Found 344 diagnostics
+ Found 345 diagnostics

setuptools (https://github.com/pypa/setuptools)
+ setuptools/config/_apply_pyprojecttoml.py:82:13: error[call-top-callable] Object of type `Top[(...) -> object]` is not safe to call; its signature is not known
+ setuptools/config/expand.py:329:14: error[call-top-callable] Object of type `Top[(...) -> object]` is not safe to call; its signature is not known
- Found 1116 diagnostics
+ Found 1118 diagnostics

hydra-zen (https://github.com/mit-ll-responsible-ai/hydra-zen)
- src/hydra_zen/wrapper/_implementations.py:435:33: warning[unused-type-ignore-comment] Unused blanket `type: ignore` directive
- src/hydra_zen/wrapper/_implementations.py:437:60: warning[unused-type-ignore-comment] Unused blanket `type: ignore` directive
- Found 518 diagnostics
+ Found 516 diagnostics

archinstall (https://github.com/archlinux/archinstall)
+ archinstall/lib/output.py:33:12: error[call-top-callable] Object of type `Top[(...) -> object]` is not safe to call; its signature is not known
- Found 69 diagnostics
+ Found 70 diagnostics

pwndbg (https://github.com/pwndbg/pwndbg)
+ pwndbg/aglib/heap/ptmalloc.py:268:30: error[call-non-callable] Object of type `~None & ~Type` is not callable
- pwndbg/aglib/heap/ptmalloc.py:269:28: error[invalid-argument-type] Argument to function `__new__` is incorrect: Expected `str | Buffer | SupportsInt | SupportsIndex | SupportsTrunc`, found `Value | None | @Todo`
+ pwndbg/aglib/heap/ptmalloc.py:269:28: error[invalid-argument-type] Argument to function `__new__` is incorrect: Expected `str | Buffer | SupportsInt | SupportsIndex | SupportsTrunc`, found `Value | None | Unknown`
+ pwndbg/aglib/heap/ptmalloc.py:600:30: error[call-non-callable] Object of type `~None & ~Type` is not callable
- pwndbg/aglib/heap/ptmalloc.py:602:28: error[invalid-argument-type] Argument to function `__new__` is incorrect: Expected `str | Buffer | SupportsInt | SupportsIndex | SupportsTrunc`, found `Value | None | @Todo`
+ pwndbg/aglib/heap/ptmalloc.py:602:28: error[invalid-argument-type] Argument to function `__new__` is incorrect: Expected `str | Buffer | SupportsInt | SupportsIndex | SupportsTrunc`, found `Value | None | Unknown`
+ pwndbg/commands/ptmalloc2.py:53:15: error[call-non-callable] Object of type `~None` is not callable
- Found 1900 diagnostics
+ Found 1903 diagnostics

xarray (https://github.com/pydata/xarray)
+ xarray/core/common.py:518:20: error[call-top-callable] Object of type `Top[(...) -> object]` is not safe to call; its signature is not known
+ xarray/core/dataarray.py:3250:21: error[call-top-callable] Object of type `Top[(...) -> object]` is not safe to call; its signature is not known
+ xarray/core/dataset.py:5880:21: error[call-top-callable] Object of type `Top[(...) -> object]` is not safe to call; its signature is not known
+ xarray/core/datatree_render.py:287:21: error[call-top-callable] Object of type `Top[(...) -> object]` is not safe to call; its signature is not known
- Found 1709 diagnostics
+ Found 1713 diagnostics

pycryptodome (https://github.com/Legrandin/pycryptodome)
- lib/Crypto/IO/_PBES.py:353:38: error[invalid-argument-type] Argument to function `scrypt` is incorrect: Expected `str`, found `@Todo | bytes`
+ lib/Crypto/IO/_PBES.py:353:38: error[invalid-argument-type] Argument to function `scrypt` is incorrect: Expected `str`, found `Unknown | bytes`
- lib/Crypto/Math/_IntegerBase.py:338:20: error[invalid-argument-type] Argument to function `bord` is incorrect: Expected `bytes`, found `@Todo | int`
+ lib/Crypto/Math/_IntegerBase.py:338:20: error[invalid-argument-type] Argument to function `bord` is incorrect: Expected `bytes`, found `Unknown | int`

hydpy (https://github.com/hydpy-dev/hydpy)
+ hydpy/exe/xmltools.py:2373:20: error[invalid-assignment] Object of type `SetItem` is not assignable to `_TypeSetOrAddOrMultiplyItem@_get_changeitem`
- Found 651 diagnostics
+ Found 652 diagnostics

dd-trace-py (https://github.com/DataDog/dd-trace-py)
+ ddtrace/internal/settings/_config.py:310:35: error[call-top-callable] Object of type `Top[(...) -> object]` is not safe to call; its signature is not known
+ ddtrace/internal/settings/_config.py:310:35: error[call-top-callable] Object of type `Top[(...) -> object]` is not safe to call; its signature is not known
+ ddtrace/internal/settings/_config.py:310:35: error[call-top-callable] Object of type `Top[(...) -> object]` is not safe to call; its signature is not known
+ ddtrace/internal/settings/_config.py:310:35: error[call-top-callable] Object of type `Top[(...) -> object]` is not safe to call; its signature is not known
+ ddtrace/internal/settings/_config.py:310:35: error[call-top-callable] Object of type `Top[(...) -> object]` is not safe to call; its signature is not known
- Found 9036 diagnostics
+ Found 9041 diagnostics

prefect (https://github.com/PrefectHQ/prefect)
+ src/integrations/prefect-dask/prefect_dask/task_runners.py:354:25: error[call-top-callable] Object of type `Top[(...) -> object]` is not safe to call; its signature is not known
+ src/integrations/prefect-dask/prefect_dask/task_runners.py:354:25: error[call-top-callable] Object of type `Top[(...) -> object]` is not safe to call; its signature is not known
- src/prefect/deployments/runner.py:1017:70: error[unresolved-attribute] Attribute `__name__` is not defined on `((...) -> Any) & ((*args: object, **kwargs: object) -> object)` in union `Unknown | (((...) -> Any) & ((*args: object, **kwargs: object) -> object))`
+ src/prefect/deployments/runner.py:1017:70: error[unresolved-attribute] Attribute `__name__` is not defined on `(...) -> Any` in union `Unknown | ((...) -> Any)`
+ src/prefect/flow_engine.py:1004:32: error[invalid-await] `Unknown | R@FlowRunEngine | Coroutine[Any, Any, R@FlowRunEngine]` is not awaitable
+ src/prefect/flow_engine.py:1610:24: error[invalid-await] `Unknown | R@AsyncFlowRunEngine | Coroutine[Any, Any, R@AsyncFlowRunEngine]` is not awaitable
+ src/prefect/flow_engine.py:1691:43: error[invalid-argument-type] Argument to function `next` is incorrect: Expected `SupportsNext[Unknown]`, found `Unknown | R@run_generator_flow_sync`
+ src/prefect/flow_engine.py:1699:21: error[unresolved-attribute] Attribute `throw` is not defined on `R@run_generator_flow_sync` in union `Unknown | R@run_generator_flow_sync`
+ src/prefect/flow_engine.py:1733:44: error[unresolved-attribute] Attribute `__anext__` is not defined on `R@run_generator_flow_async` in union `Unknown | R@run_generator_flow_async`
+ src/prefect/flow_engine.py:1740:25: error[unresolved-attribute] Attribute `throw` is not defined on `R@run_generator_flow_async` in union `Unknown | R@run_generator_flow_async`
- src/prefect/flows.py:286:34: error[unresolved-attribute] Object of type `((**P@Flow) -> R@Flow) & ((*args: object, **kwargs: object) -> object)` has no attribute `__name__`
+ src/prefect/flows.py:286:34: error[unresolved-attribute] Object of type `(**P@Flow) -> R@Flow` has no attribute `__name__`
- src/prefect/flows.py:404:68: error[unresolved-attribute] Object of type `((**P@Flow) -> R@Flow) & ((*args: object, **kwargs: object) -> object)` has no attribute `__name__`
+ src/prefect/flows.py:404:68: error[unresolved-attribute] Object of type `(**P@Flow) -> R@Flow` has no attribute `__name__`
- src/prefect/flows.py:1886:53: warning[unused-type-ignore-comment] Unused blanket `type: ignore` directive
+ src/prefect/flows.py:1946:21: error[no-matching-overload] No overload of function `run_coro_as_sync` matches arguments
- src/prefect/server/models/workers.py:299:64: warning[unused-type-ignore-comment] Unused blanket `type: ignore` directive
+ src/prefect/server/models/workers.py:298:19: error[missing-argument] No arguments provided for required parameters 1, 2, 3, 4
+ src/prefect/server/models/workers.py:300:17: error[unknown-argument] Argument `occurred` does not match any known parameter
+ src/prefect/server/models/workers.py:301:17: error[unknown-argument] Argument `pre_update_work_pool` does not match any known parameter
+ src/prefect/server/models/workers.py:302:17: error[unknown-argument] Argument `work_pool` does not match any known parameter
+ src/prefect/tasks.py:569:40: error[call-top-callable] Object of type `Top[(...) -> object]` is not safe to call; its signature is not known
+ src/prefect/tasks.py:569:40: error[call-top-callable] Object of type `Top[(...) -> object]` is not safe to call; its signature is not known
+ src/prefect/tasks.py:569:40: error[call-top-callable] Object of type `Top[(...) -> object]` is not safe to call; its signature is not known
- src/prefect/tasks.py:1635:20: error[invalid-return-type] Return type does not match returned value: expected `list[State[R@Task]] | PrefectFutureList[R@Task]`, found `list[Unknown | PrefectDistributedFuture[R@Task]] | @Todo`
+ src/prefect/tasks.py:1635:20: error[invalid-return-type] Return type does not match returned value: expected `list[State[R@Task]] | PrefectFutureList[R@Task]`, found `list[Unknown | PrefectDistributedFuture[R@Task]] | Any`
+ src/prefect/utilities/_engine.py:40:25: error[call-top-callable] Object of type `Top[(...) -> object]` is not safe to call; its signature is not known
+ src/prefect/utilities/_engine.py:66:29: error[call-top-callable] Object of type `Top[(...) -> object]` is not safe to call; its signature is not known
+ src/prefect/utilities/_engine.py:69:29: error[call-top-callable] Object of type `Top[(...) -> object]` is not safe to call; its signature is not known
- Found 5488 diagnostics
+ Found 5505 diagnostics

pywin32 (https://github.com/mhammond/pywin32)
+ com/win32com/server/policy.py:145:18: error[call-non-callable] Object of type `str` is not callable
- Found 2736 diagnostics
+ Found 2737 diagnostics

bokeh (https://github.com/bokeh/bokeh)
+ src/bokeh/core/property/bases.py:188:20: error[call-top-callable] Object of type `Top[(...) -> object]` is not safe to call; its signature is not known
+ src/bokeh/core/property/instance.py:106:29: error[invalid-assignment] Object of type `type[T@Object]` is not assignable to `type[Serializable]`
+ src/bokeh/core/property/instance.py:108:13: error[invalid-assignment] Object of type `type[Serializable]` is not assignable to attribute `_instance_type` of type `type[T@Object] | (() -> type[T@Object]) | str`
+ src/bokeh/io/notebook.py:566:18: error[call-top-callable] Object of type `Top[(...) -> object]` is not safe to call; its signature is not known
+ src/bokeh/io/notebook.py:578:15: error[call-top-callable] Object of type `Top[(...) -> object]` is not safe to call; its signature is not known
+ src/bokeh/plotting/graph.py:123:28: error[call-top-callable] Object of type `Top[(...) -> object]` is not safe to call; its signature is not known
+ src/bokeh/resources.py:473:41: error[invalid-argument-type] Argument to function `__call__` is incorrect: Expected `list[str]`, found `list[Literal["bokeh", "bokeh-gl", "bokeh-widgets", "bokeh-tables", "bokeh-mathjax", "bokeh-api"]]`
+ src/bokeh/server/views/metadata_handler.py:60:24: error[call-top-callable] Object of type `Top[(...) -> object]` is not safe to call; its signature is not known
- src/bokeh/settings.py:414:20: error[invalid-return-type] Return type does not match returned value: expected `tuple[T@PrioritizedSetting, SettingProvenance]`, found `tuple[Unknown | str, Literal[SettingProvenance.IMMEDIATE]]`
+ src/bokeh/settings.py:414:20: error[invalid-return-type] Return type does not match returned value: expected `tuple[T@PrioritizedSetting, SettingProvenance]`, found `tuple[Unknown | T@PrioritizedSetting | str, Literal[SettingProvenance.IMMEDIATE]]`
- src/bokeh/settings.py:418:20: error[invalid-return-type] Return type does not match returned value: expected `tuple[T@PrioritizedSetting, SettingProvenance]`, found `tuple[Unknown | str, Literal[SettingProvenance.USER_SET]]`
+ src/bokeh/settings.py:418:20: error[invalid-return-type] Return type does not match returned value: expected `tuple[T@PrioritizedSetting, SettingProvenance]`, found `tuple[Unknown | T@PrioritizedSetting | str, Literal[SettingProvenance.USER_SET]]`
+ src/bokeh/settings.py:418:34: error[invalid-argument-type] Argument is incorrect: Expected `T@PrioritizedSetting | str`, found `str | (T@PrioritizedSetting & ~<class '_Unset'>) | (type[_Unset] & ~<class '_Unset'>)`
- src/bokeh/settings.py:422:20: error[invalid-return-type] Return type does not match returned value: expected `tuple[T@PrioritizedSetting, SettingProvenance]`, found `tuple[Unknown | str, Literal[SettingProvenance.CONFIG_OVERRIDE]]`
+ src/bokeh/settings.py:422:20: error[invalid-return-type] Return type does not match returned value: expected `tuple[T@PrioritizedSetting, SettingProvenance]`, found `tuple[Unknown | T@PrioritizedSetting | str, Literal[SettingProvenance.CONFIG_OVERRIDE]]`
- src/bokeh/settings.py:426:20: error[invalid-return-type] Return type does not match returned value: expected `tuple[T@PrioritizedSetting, SettingProvenance]`, found `tuple[Unknown | str, Literal[SettingProvenance.ENV_VAR]]`
+ src/bokeh/settings.py:426:20: error[invalid-return-type] Return type does not match returned value: expected `tuple[T@PrioritizedSetting, SettingProvenance]`, found `tuple[Unknown | T@PrioritizedSetting | str, Literal[SettingProvenance.ENV_VAR]]`
- src/bokeh/settings.py:430:20: error[invalid-return-type] Return type does not match returned value: expected `tuple[T@PrioritizedSetting, SettingProvenance]`, found `tuple[Unknown | str, Literal[SettingProvenance.CONFIG_USER]]`
+ src/bokeh/settings.py:430:20: error[invalid-return-type] Return type does not match returned value: expected `tuple[T@PrioritizedSetting, SettingProvenance]`, found `tuple[Unknown | T@PrioritizedSetting | str, Literal[SettingProvenance.CONFIG_USER]]`
- src/bokeh/settings.py:434:20: error[invalid-return-type] Return type does not match returned value: expected `tuple[T@PrioritizedSetting, SettingProvenance]`, found `tuple[Unknown | str, Literal[SettingProvenance.CONFIG_SYSTEM]]`
+ src/bokeh/settings.py:434:20: error[invalid-return-type] Return type does not match returned value: expected `tuple[T@PrioritizedSetting, SettingProvenance]`, found `tuple[Unknown | T@PrioritizedSetting | str, Literal[SettingProvenance.CONFIG_SYSTEM]]`
- src/bokeh/settings.py:438:20: error[invalid-return-type] Return type does not match returned value: expected `tuple[T@PrioritizedSetting, SettingProvenance]`, found `tuple[Unknown | str, Literal[SettingProvenance.DEV_DEFAULT]]`
+ src/bokeh/settings.py:438:20: error[invalid-return-type] Return type does not match returned value: expected `tuple[T@PrioritizedSetting, SettingProvenance]`, found `tuple[Unknown | T@PrioritizedSetting | str, Literal[SettingProvenance.DEV_DEFAULT]]`
+ src/bokeh/settings.py:438:34: error[invalid-argument-type] Argument is incorrect: Expected `T@PrioritizedSetting | str`, found `(Unknown & ~<class '_Unset'>) | (T@PrioritizedSetting & ~<class '_Unset'>) | (type[_Unset] & ~<class '_Unset'>)`
- src/bokeh/settings.py:442:20: error[invalid-return-type] Return type does not match returned value: expected `tuple[T@PrioritizedSetting, SettingProvenance]`, found `tuple[Unknown | str, Literal[SettingProvenance.DEFAULT]]`
+ src/bokeh/settings.py:442:20: error[invalid-return-type] Return type does not match returned value: expected `tuple[T@PrioritizedSetting, SettingProvenance]`, found `tuple[Unknown | T@PrioritizedSetting | str, Literal[SettingProvenance.DEFAULT]]`
+ src/bokeh/settings.py:442:34: error[invalid-argument-type] Argument is incorrect: Expected `T@PrioritizedSetting | str`, found `(T@PrioritizedSetting & ~<class '_Unset'>) | (type[_Unset] & ~<class '_Unset'>)`
- src/bokeh/settings.py:446:20: error[invalid-return-type] Return type does not match returned value: expected `tuple[T@PrioritizedSetting, SettingProvenance]`, found `tuple[Unknown | str, Literal[SettingProvenance.GLOBAL_DEFAULT]]`
+ src/bokeh/settings.py:446:20: error[invalid-return-type] Return type does not match returned value: expected `tuple[T@PrioritizedSetting, SettingProvenance]`, found `tuple[Unknown | T@PrioritizedSetting | str, Literal[SettingProvenance.GLOBAL_DEFAULT]]`
+ src/bokeh/settings.py:446:34: error[invalid-argument-type] Argument is incorrect: Expected `T@PrioritizedSetting | str`, found `(Unknown & ~<class '_Unset'>) | (T@PrioritizedSetting & ~<class '_Unset'>) | (type[_Unset] & ~<class '_Unset'>)`
- Found 840 diagnostics
+ Found 852 diagnostics

streamlit (https://github.com/streamlit/streamlit)
+ lib/streamlit/navigation/page.py:340:17: error[call-top-callable] Object of type `Top[(...) -> object]` is not safe to call; its signature is not known
+ lib/streamlit/web/server/server_util.py:104:13: error[call-top-callable] Object of type `Top[(...) -> object]` is not safe to call; its signature is not known
- Found 13 diagnostics
+ Found 15 diagnostics

ibis (https://github.com/ibis-project/ibis)
+ ibis/backends/sql/datatypes.py:1728:25: error[invalid-argument-type] Argument is incorrect: Expected `bool`, found `Unknown | Float16 | Float32 | ... omitted 5 union elements`
- ibis/expr/operations/core.py:65:34: error[invalid-argument-type] Argument to function `__new__` is incorrect: Expected `str | Buffer | SupportsInt | SupportsIndex | SupportsTrunc`, found `(@Todo & ~Value[object, object]) | None`
+ ibis/expr/operations/core.py:65:34: error[invalid-argument-type] Argument to function `__new__` is incorrect: Expected `str | Buffer | SupportsInt | SupportsIndex | SupportsTrunc`, found `(Any & ~Expr & ~Value[object, object]) | None`
- ibis/expr/operations/core.py:67:36: error[invalid-argument-type] Argument to function `__new__` is incorrect: Expected `str | Buffer | SupportsFloat | SupportsIndex`, found `(@Todo & ~Value[object, object]) | None`
+ ibis/expr/operations/core.py:67:36: error[invalid-argument-type] Argument to function `__new__` is incorrect: Expected `str | Buffer | SupportsFloat | SupportsIndex`, found `(Any & ~Expr & ~Value[object, object]) | None`
- ibis/expr/types/temporal.py:324:23: error[invalid-argument-type] Argument is incorrect: Expected `Value[Time | Timestamp, Any]`, found `@Todo | Self@between`
+ ibis/expr/types/temporal.py:324:23: error[invalid-argument-type] Argument is incorrect: Expected `Value[Time | Timestamp, Any]`, found `Unknown | Self@between`
+ ibis/expr/visualize.py:122:46: error[invalid-argument-type] Argument is incorrect: Expected `ibis.expr.operations.core.Node`, found `ibis.common.graph.Node`
+ ibis/expr/visualize.py:132:50: error[invalid-argument-type] Argument is incorrect: Expected `ibis.expr.operations.core.Node`, found `ibis.common.graph.Node`
+ ibis/expr/visualize.py:164:50: error[invalid-argument-type] Argument is incorrect: Expected `ibis.expr.operations.core.Node`, found `ibis.common.graph.Node`
+ ibis/expr/visualize.py:164:53: error[invalid-argument-type] Argument is incorrect: Expected `ibis.expr.operations.core.Node`, found `ibis.common.graph.Node`
- ibis/legacy/udf/vectorized.py:188:5: error[invalid-assignment] Object of type `Attribute` is not assignable to attribute `columns` on type `@Todo | DataFrame`
+ ibis/legacy/udf/vectorized.py:188:5: error[invalid-assignment] Object of type `Attribute` is not assignable to attribute `columns` on type `Unknown | DataFrame`
+ ibis/selectors.py:456:28: error[call-top-callable] Object of type `Top[(...) -> object]` is not safe to call; its signature is not known
- Found 4865 diagnostics
+ Found 4871 diagnostics

pandas (https://github.com/pandas-dev/pandas)
+ pandas/core/apply.py:1063:25: error[call-top-callable] Object of type `Top[(...) -> object]` is not safe to call; its signature is not known
+ pandas/core/apply.py:1063:25: error[call-top-callable] Object of type `Top[(...) -> object]` is not safe to call; its signature is not known
+ pandas/core/apply.py:1063:25: error[call-top-callable] Object of type `Top[(...) -> object]` is not safe to call; its signature is not known
+ pandas/core/apply.py:1067:25: error[call-top-callable] Object of type `Top[(...) -> object]` is not safe to call; its signature is not known
+ pandas/core/apply.py:1067:25: error[call-top-callable] Object of type `Top[(...) -> object]` is not safe to call; its signature is not known
+ pandas/core/apply.py:1067:25: error[call-top-callable] Object of type `Top[(...) -> object]` is not safe to call; its signature is not known
+ pandas/core/apply.py:1079:21: error[call-top-callable] Object of type `Top[(...) -> object]` is not safe to call; its signature is not known
+ pandas/core/apply.py:1079:21: error[call-top-callable] Object of type `Top[(...) -> object]` is not safe to call; its signature is not known
+ pandas/core/apply.py:1079:21: error[call-top-callable] Object of type `Top[(...) -> object]` is not safe to call; its signature is not known
+ pandas/core/apply.py:1147:19: error[call-top-callable] Object of type `Top[(...) -> object]` is not safe to call; its signature is not known
+ pandas/core/apply.py:1147:19: error[call-top-callable] Object of type `Top[(...) -> object]` is not safe to call; its signature is not known
+ pandas/core/apply.py:1147:19: error[call-top-callable] Object of type `Top[(...) -> object]` is not safe to call; its signature is not known
+ pandas/core/apply.py:1184:26: error[call-top-callable] Object of type `Top[(...) -> object]` is not safe to call; its signature is not known
+ pandas/core/apply.py:1184:26: error[call-top-callable] Object of type `Top[(...) -> object]` is not safe to call; its signature is not known
+ pandas/core/apply.py:1184:26: error[call-top-callable] Object of type `Top[(...) -> object]` is not safe to call; its signature is not known
+ pandas/core/apply.py:1530:22: error[call-top-callable] Object of type `Top[(...) -> object]` is not safe to call; its signature is not known
+ pandas/core/apply.py:1530:22: error[call-top-callable] Object of type `Top[(...) -> object]` is not safe to call; its signature is not known
+ pandas/core/apply.py:1530:22: error[call-top-callable] Object of type `Top[(...) -> object]` is not safe to call; its signature is not known
- pandas/core/arrays/boolean.py:260:12: error[invalid-return-type] Return type does not match returned value: expected `tuple[ndarray[tuple[Any, ...], dtype[Any]], ndarray[tuple[Any, ...], dtype[Any]]]`, found `tuple[@Todo | ndarray[tuple[int], dtype[Any]], Unknown | None | ndarray[tuple[Any, ...], dtype[numpy.bool[builtins.bool]]] | ndarray[tuple[Any, ...], dtype[Any]]]`
+ pandas/core/arrays/boolean.py:260:12: error[invalid-return-type] Return type does not match returned value: expected `tuple[ndarray[tuple[Any, ...], dtype[Any]], ndarray[tuple[Any, ...], dtype[Any]]]`, found `tuple[(Unknown & ndarray[tuple[object, ...], dtype[object]]) | ndarray[tuple[int], dtype[Any]], Unknown | None | ndarray[tuple[Any, ...], dtype[numpy.bool[builtins.bool]]] | ndarray[tuple[Any, ...], dtype[Any]]]`
+ pandas/core/computation/expr.py:715:37: error[call-non-callable] Object of type `~FuncNode` is not callable
- pandas/core/frame.py:635:56: error[invalid-argument-type] Argument to function `construct_1d_arraylike_from_scalar` is incorrect: Expected `str | bytes | date | ... omitted 10 union elements`, found `(@Todo & ~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:635: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:641:21: error[invalid-argument-type] Argument to function `construct_2d_arraylike_from_scalar` is incorrect: Expected `str | bytes | date | ... omitted 10 union elements`, found `(@Todo & ~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:641: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/methods/describe.py:215:21: error[not-iterable] Object of type `Sized | Unknown` may not be iterable
+ pandas/core/methods/describe.py:215:21: error[not-iterable] Object of type `Unknown | Sized` may not be iterable
- pandas/core/ops/array_ops.py:129:48: error[invalid-argument-type] Argument to function `vec_compare` is incorrect: Expected `ndarray[tuple[Any, ...], dtype[object_]]`, found `@Todo | ndarray[tuple[int], dtype[Any]] | ndarray[tuple[int], Unknown] | ExtensionArray`
+ pandas/core/ops/array_ops.py:129:48: error[invalid-argument-type] Argument to function `vec_compare` is incorrect: Expected `ndarray[tuple[Any, ...], dtype[object_]]`, found `Unknown | ndarray[tuple[int], dtype[Any]] | ndarray[tuple[int], Unknown] | ExtensionArray`
- pandas/io/excel/_base.py:1379:16: error[invalid-return-type] Return type does not match returned value: expected `tuple[int | float | str | date, str | None]`, found `tuple[@Todo | int | float | Decimal | str, None | Unknown | str]`
+ pandas/io/excel/_base.py:1379:16: error[invalid-return-type] Return type does not match returned value: expected `tuple[int | float | str | date, str | None]`, found `tuple[(Unknown & date) | int | float | Decimal | str, None | Unknown | str]`
- pandas/io/formats/format.py:1312:44: warning[unused-type-ignore-comment] Unused blanket `type: ignore` directive
+ pandas/io/formats/style.py:4516:20: error[call-top-callable] Object of type `Top[(...) -> object]` is not safe to call; its signature is not known
+ pandas/io/formats/style.py:4516:20: error[call-top-callable] Object of type `Top[(...) -> object]` is not safe to call; its signature is not known
+ pandas/io/formats/style.py:4516:20: error[call-top-callable] Object of type `Top[(...) -> object]` is not safe to call; its signature is not known
+ pandas/io/parsers/base_parser.py:996:54: error[call-top-callable] Object of type `Top[(...) -> object]` is not safe to call; its signature is not known
+ pandas/util/_decorators.py:197:41: error[call-top-callable] Object of type `Top[(...) -> object]` is not safe to call; its signature is not known
- Found 4428 diagnostics
+ Found 4451 diagnostics

static-frame (https://github.com/static-frame/static-frame)
- static_frame/core/container_util.py:496:25: warning[unused-type-ignore-comment] Unused blanket `type: ignore` directive
- static_frame/core/container_util.py:497:59: warning[unused-type-ignore-comment] Unused blanket `type: ignore` directive
- static_frame/core/container_util.py:1859:36: warning[unused-type-ignore-comment] Unused blanket `type: ignore` directive
- static_frame/core/container_util.py:1875:41: warning[unused-type-ignore-comment] Unused blanket `type: ignore` directive
- static_frame/core/container_util.py:1876:56: warning[unused-type-ignore-comment] Unused blanket `type: ignore` directive
- static_frame/core/container_util.py:1890:50: warning[unused-type-ignore-comment] Unused blanket `type: ignore` directive
- static_frame/core/frame.py:6623:44: warning[unused-type-ignore-comment] Unused blanket `type: ignore` directive
+ static_frame/core/frame.py:6612:39: error[index-out-of-bounds] Index 1 is out of bounds for tuple `tuple[int]` with length 1
+ static_frame/core/frame.py:6658:40: error[index-out-of-bounds] Index 1 is out of bounds for tuple `tuple[int]` with length 1
- static_frame/core/frame.py:6663:47: warning[unused-type-ignore-comment] Unused blanket `type: ignore` directive
- static_frame/core/frame.py:6668:69: warning[unused-type-ignore-comment] Unused blanket `type: ignore` directive
- static_frame/core/frame.py:6671:55: warning[unused-type-ignore-comment] Unused blanket `type: ignore` directive
+ static_frame/core/frame.py:6661:64: error[index-out-of-bounds] Index 1 is out of bounds for tuple `tuple[int]` with length 1
+ static_frame/core/frame.py:6667:20: error[index-out-of-bounds] Index 1 is out of bounds for tuple `tuple[int]` with length 1
+ static_frame/core/frame.py:6672:40: error[index-out-of-bounds] Index 1 is out of bounds for tuple `tuple[int]` with length 1
+ static_frame/core/index.py:1001:32: error[call-top-callable] Object of type `Top[(...) -> object]` is not safe to call; its signature is not known
- static_frame/core/index_auto.py:139:63: warning[unused-type-ignore-comment] Unused blanket `type: ignore` directive
- static_frame/core/index_auto.py:142:68: warning[unused-type-ignore-comment] Unused blanket `type: ignore` directive
- static_frame/core/series.py:2510:78: warning[unused-type-ignore-comment] Unused blanket `type: ignore` directive
- static_frame/test/unit/test_frame_iter.py:1389:13: error[unresolved-attribute] Attribute `to_pairs` is not defined on `tuple[Any, Any]` in union `tuple[Any, Any] | Any`
+ static_frame/test/unit/test_frame_iter.py:1389:13: error[unresolved-attribute] Attribute `to_pairs` is not defined on `tuple[Any, Any]` in union `Any | tuple[Any, Any]`
- static_frame/test/unit/test_frame_iter.py:1397:13: error[unresolved-attribute] Attribute `to_pairs` is not defined on `tuple[Any, Any]` in union `tuple[Any, Any] | Any`
+ static_frame/test/unit/test_frame_iter.py:1397:13: error[unresolved-attribute] Attribute `to_pairs` is not defined on `tuple[Any, Any]` in union `Any | tuple[Any, Any]`
- static_frame/test/unit/test_frame_iter.py:1408:13: error[unresolved-attribute] Attribute `to_pairs` is not defined on `tuple[Any, Any]` in union `tuple[Any, Any] | Any`
+ static_frame/test/unit/test_frame_iter.py:1408:13: error[unresolved-attribute] Attribute `to_pairs` is not defined on `tuple[Any, Any]` in union `Any | tuple[Any, Any]`
- static_frame/test/unit/test_frame_iter.py:1411:13: error[unresolved-attribute] Attribute `to_pairs` is not defined on `tuple[Any, Any]` in union `tuple[Any, Any] | Any`
+ static_frame/test/unit/test_frame_iter.py:1411:13: error[unresolved-attribute] Attribute `to_pairs` is not defined on `tuple[Any, Any]` in union `Any | tuple[Any, Any]`
- static_frame/test/unit/test_frame_iter.py:1431:13: error[unresolved-attribute] Attribute `to_pairs` is not defined on `tuple[Any, Any]` in union `tuple[Any, Any] | Any`
+ static_frame/test/unit/test_frame_iter.py:1431:13: error[unresolved-attribute] Attribute `to_pairs` is not defined on `tuple[Any, Any]` in union `Any | tuple[Any, Any]`
- static_frame/test/unit/test_frame_iter.py:1439:13: error[unresolved-attribute] Attribute `to_pairs` is not defined on `tuple[Any, Any]` in union `tuple[Any, Any] | Any`
+ static_frame/test/unit/test_frame_iter.py:1439:13: error[unresolved-attribute] Attribute `to_pairs` is not defined on `tuple[Any, Any]` in union `Any | tuple[Any, Any]`
- static_frame/test/unit/test_frame_iter.py:1481:13: error[unresolved-attribute] Attribute `to_pairs` is not defined on `tuple[Any, Any]` in union `tuple[Any, Any] | Any`
+ static_frame/test/unit/test_frame_iter.py:1481:13: error[unresolved-attribute] Attribute `to_pairs` is not defined on `tuple[Any, Any]` in union `Any | tuple[Any, Any]`
- static_frame/test/unit/test_frame_iter.py:1489:13: error[unresolved-attribute] Attribute `to_pairs` is not defined on `tuple[Any, Any]` in union `tuple[Any, Any] | Any`
+ static_frame/test/unit/test_frame_iter.py:1489:13: error[unresolved-attri

... (truncated 170 lines) ...

@astral-sh-bot
Copy link

astral-sh-bot bot commented Jan 9, 2026

ecosystem-analyzer results

Lint rule Added Removed Changed
call-top-callable 121 0 0
invalid-argument-type 24 1 40
unresolved-attribute 30 0 18
unused-type-ignore-comment 0 24 0
unknown-argument 19 0 0
invalid-return-type 3 0 15
call-non-callable 16 1 0
missing-argument 12 0 0
invalid-assignment 6 0 3
too-many-positional-arguments 6 0 0
unsupported-operator 1 0 5
index-out-of-bounds 5 0 0
no-matching-overload 3 0 0
not-iterable 0 0 1
type-assertion-failure 1 0 0
Total 247 26 82

Full report with detailed diff (timing results)

Implement proper handling for calling intersection types. Previously,
calling an intersection type would return a `@Todo` type that suppressed
errors but provided no useful type information.

Now, when calling an intersection type:
- We try to call each positive element with the given arguments
- Elements where the call fails (wrong arguments, not callable, etc.)
  are discarded
- If at least one element succeeds, the call is valid
- The return type is the intersection of return types from successful
  elements
- If all elements fail, an appropriate error is reported

This approach means that if an intersection contains both a callable
with a known signature and a `Top[Callable[..., object]]` (from
narrowing by `callable()`), the call will succeed using the element
with the known signature, avoiding spurious `call-top-callable` errors.

Fixes astral-sh/ty#1858
@carljm carljm force-pushed the claude/fix-issue-1858-UjARA branch from 3dae02a to f39370a Compare January 9, 2026 04:00
claude added 7 commits January 9, 2026 04:09
When calling an intersection type where all callable elements reject
the specific call arguments, we now show an error for each failing
element (similar to how unions work) instead of a single generic
"not callable" error.

This is achieved by:
- Not filtering out failed elements when ALL elements fail
- Returning BindingError instead of NotCallable to trigger individual diagnostics
- Adding IntersectionDiagnostic struct and CompoundDiagnostic trait
- Modifying report_diagnostics to iterate over intersection elements
More diagnostics are now emitted due to showing individual errors
when all intersection elements fail a call.
When all intersection elements fail a call, we now use a priority
hierarchy to determine which errors to show:

1. NotCallable (lowest) - object has no __call__ method
2. TopCallable - object is a top callable with unknown signature
3. BindingError (highest) - specific errors like invalid-argument-type

Only errors from the highest priority category are shown. This prevents
noise from less-specific errors when more informative errors are available.

For example, if an intersection has one element that fails with
invalid-argument-type and another that's not callable, we only show
the invalid-argument-type error since it's more specific and actionable.
Refactors the `Bindings` structure to use a two-level representation:
- Outer level: union elements (each can be a single callable or an intersection)
- Inner level: bindings within an intersection element

This enables proper handling of types like `(A & B) | C` when calling,
where `A & B` is an intersection that was narrowed by `callable()`.

Key changes:
- Add `BindingsElement` struct to represent a single union element
  (which may contain multiple bindings for intersections)
- Update `from_union` to preserve intersection structure instead of
  flattening
- Update `from_intersection` to create a single element with multiple
  bindings
- Update `return_type`, `check_types_impl`, and `report_diagnostics`
  to handle the two-level structure
- Add test for union-of-intersections case

The priority hierarchy for intersection call errors is preserved: when
all bindings in an intersection fail, only the highest-priority error
type is reported (BindingError > TopCallable > NotCallable).
Resolves conflicts between the two-level Bindings structure and
main's new Type match cases for property descriptors, dataclass
transformers, and other features.
@carljm carljm force-pushed the claude/fix-issue-1858-UjARA branch 4 times, most recently from 06c217d to f72e874 Compare January 9, 2026 20:46
This PR fixes false `invalid-await` errors for patterns like:
```python
if inspect.isawaitable(x):
    await x  # x has type Unknown & Awaitable[object]
```

Changes:
1. Add intersection handling to `generator_return_type()` so that await
   operations on intersection types work correctly. When awaiting an
   intersection, we iterate over positive elements, collect return types
   from awaitable elements, and intersect them together. Non-awaitable
   elements are skipped; only if all elements fail to be awaitable do we
   report an error.

2. Add intersection handling to `try_call_dunder_with_policy()` to call
   dunder methods on each intersection element separately and combine the
   results. This avoids intersecting bound methods (which often collapses
   to Never) and instead intersects the return types.

Added tests for:
- Awaiting `Unknown & Awaitable[object]` returns `Unknown`
- Awaiting intersection of two Coroutine types
- Awaiting intersection with non-awaitable elements skips those elements
- Awaiting intersection where all elements are non-awaitable produces error
@carljm carljm force-pushed the claude/fix-issue-1858-UjARA branch from f72e874 to 01b1937 Compare January 9, 2026 21:04
When multiple bindings in an intersection (or multiple elements in a union)
return argument forms from type checking (e.g., during argument type expansion),
we should merge them to properly detect conflicting forms, rather than
overwriting with the last one.
Use error priority to select the appropriate error kind when all bindings
fail, rather than handling intersection and single-binding cases separately.
This addresses review comments 2 and 3 from PR #22469.
Update the doc comment to clarify that Bindings represents a union of
callables (possibly size one), where each element is an intersection
(possibly size one). This addresses review comment 5 from PR #22469.
…allable()

- Add is_callable() method to BindingsElement for clearer element-level checks
- Update report_diagnostics to iterate over elements instead of flattened bindings
- Add documentation to iter() and iter_mut() clarifying they flatten the structure

This addresses review comments 6 and 7 from PR #22469.
Simplify the call site by moving the is_intersection() and as_result().is_ok()
checks inside retain_successful(). This addresses review comment 8 from PR #22469.
When an intersection fails inside a union, report errors with both
union and intersection context:
- Add LayeredDiagnostic that combines both contexts
- Show the correct intersection type (not the full union)
- Include test with snapshot diagnostics demonstrating the layered output

This addresses review comment 9 from PR #22469.
* main: (76 commits)
  [ty] Improve the check for `NewType`s with generic bases (#22961)
  [ty] Ban legacy `TypeVar` bounds or constraints from containing type variables (#22949)
  Bump the typing conformance suite pin (#22960)
  [ty] Emit an error if a TypeVarTuple is used to subscript `Generic` or `Protocol` without being unpacked (#22952)
  [ty] Reduce false positives when subscripting classes generic over `TypeVarTuple`s (#22950)
  [ty] Detect invalid attempts to subclass `Protocol[]` and `Generic[]` simultaneously (#22948)
  Fix suppression indentation matching (#22903)
  Remove hidden `--output-format` warning (#22944)
  [ty] Validate signatures of dataclass `__post_init__` methods (#22730)
  [ty] extend special-cased `numbers` diagnostic to `invalid-argument-type` errors (#22938)
  [ty] Avoid false positive for `not-iterable` with no-positive intersection types (#22089)
  [ty] Preserve pure negation types in descriptor protocol (#22907)
  [ty] add special-case diagnostic for `numbers` module (#22931)
  [ty] Move the location of more `invalid-overload` diagnostics (#22933)
  [ty] Fix unary and comparison operators for TypeVars with union bounds (#22925)
  [ty] Rule Selection: ignore/warn/select all rules (unless subsequently overriden) (#22832)
  [ty] Fix TypedDict construction from existing TypedDict values (#22904)
  [ty] fix bug in string annotations and clean up diagnostics (#22913)
  [ty] Improve support for goto-type, goto-declaration, hover, and highlighting of string annotations (#22878)
  [ty] Rename old typing imports to new on `unresolved-reference`. (#22827)
  ...
* main: (48 commits)
  add info for non_octal permissions (#22972)
  Fix empty body rule rendering (#23039)
  [ty] Infer `ParamSpec` from class constructors for callable protocols (#22853)
  Update NPM Development dependencies (#23030)
  Update CodSpeedHQ/action action to v4.8.2 (#23029)
  [ty] remove special handling for `Any()` in match class patterns (#23011)
  Update Rust crate get-size2 to v0.7.4 (#23022)
  Update Rust crate insta to v1.46.1 (#23023)
  Update taiki-e/install-action action to v2.67.11 (#23033)
  Update Rust crate colored to v3.1.1 (#23031)
  Update cargo-bins/cargo-binstall action to v1.17.3 (#23028)
  Update Rust crate uuid to v1.20.0 (#23032)
  [ty] Avoid using `.node()` for detecting `Self` (#23000)
  Update Rust crate proc-macro2 to v1.0.106 (#23024)
  Update actions/setup-python action to v6.2.0 (#23027)
  [ty] fix query cycles in decorated function with parameter defaults (#23014)
  Update Rust crate quote to v1.0.44 (#23025)
  Update Rust crate thiserror to v2.0.18 (#23026)
  Update Rust crate filetime to v0.2.27 (#23021)
  Update Rust crate clearscreen to v4.0.3 (#23020)
  ...
* main: (209 commits)
  [ty] Defer base inference for functional `type(...)` classes (#22792)
  flake8-executable: allow global flags in uv shebangs (EXE003) (#22582)
  [ty] Add `replace-imports-with-any` option (#23122)
  Update html comments in mdtests (#23269)
  Apply ruff formatting to mdtests (#22935)
  [ty] Exclude test-related symbols from non-first-party packages in auto-import completions
  [ty] Refactor `CursorTest` helper to support site-packages
  [ty] Qualify inlay hint edit symbol when possibly referencing another variable (#23265)
  [ty] Avoid `UnionBuilder` overhead when creating a new union from the filtered elements of an existing union (#22352)
  [ty] Refactor TypedDict key assignment validation (#23262)
  [ty] Improve Python environment path documentation (#23256)
  [ty] loop control flow analysis using loop header definitions
  Prepare for 0.15.1 (#23253)
  Remove docker-run-action (#23254)
  [ty] Allow discovering dependencies in system Python environments (#22994)
  Ensure pending suppression diagnostics are reported (#23242)
  [`isort`] support for configurable import section heading comments (#23151)
  [ty] Fix method calls on subclasses of `Any` (#23248)
  [ty] Fix bound method access on `None` (#23246)
  Make range suppression test snapshot actually useful (#23251)
  ...
@astral-sh-bot
Copy link

astral-sh-bot bot commented Feb 14, 2026

Memory usage report

Summary

Project Old New Diff Outcome
prefect 694.15MB 694.34MB +0.03% (193.10kB)
sphinx 276.42MB 276.45MB +0.01% (29.52kB)
trio 120.57MB 120.58MB +0.01% (8.42kB)
flake8 49.73MB 49.73MB +0.00% (1.24kB)

Significant changes

Click to expand detailed breakdown

prefect

Name Old New Diff Outcome
infer_expression_types_impl 54.35MB 54.41MB +0.12% (67.57kB)
infer_scope_types_impl 57.89MB 57.92MB +0.06% (36.03kB)
infer_definition_types 86.89MB 86.92MB +0.03% (25.72kB)
Type<'db>::apply_specialization_ 3.70MB 3.71MB +0.30% (11.36kB)
Type<'db>::apply_specialization_::interned_arguments 2.82MB 2.83MB +0.34% (9.92kB)
Type<'db>::class_member_with_policy_ 16.88MB 16.88MB +0.05% (8.80kB)
Type<'db>::member_lookup_with_policy_::interned_arguments 5.29MB 5.28MB -0.15% (8.02kB)
StaticClassLiteral<'db>::implicit_attribute_inner_ 9.86MB 9.87MB +0.07% (7.37kB)
check_file_impl 16.74MB 16.75MB +0.04% (6.64kB)
infer_unpack_types 846.17kB 852.27kB +0.72% (6.11kB)
Type<'db>::member_lookup_with_policy_ 14.87MB 14.87MB -0.03% (4.85kB)
Type<'db>::try_call_dunder_get_ 11.21MB 11.21MB +0.04% (4.84kB)
FunctionType<'db>::signature_ 3.78MB 3.78MB +0.10% (3.85kB)
infer_deferred_types 14.69MB 14.69MB +0.02% (3.33kB)
StaticClassLiteral<'db>::try_mro_ 6.03MB 6.03MB -0.05% (3.03kB)
... 38 more

sphinx

Name Old New Diff Outcome
infer_expression_types_impl 22.95MB 22.96MB +0.04% (9.55kB)
Type<'db>::member_lookup_with_policy_::interned_arguments 2.54MB 2.54MB -0.17% (4.37kB)
Type<'db>::member_lookup_with_policy_ 6.30MB 6.30MB -0.06% (3.95kB)
Type<'db>::apply_specialization_::interned_arguments 1.48MB 1.48MB +0.24% (3.59kB)
Type<'db>::apply_specialization_ 1.74MB 1.75MB +0.19% (3.46kB)
infer_scope_types_impl 17.56MB 17.56MB +0.02% (3.45kB)
infer_definition_types 25.23MB 25.23MB +0.01% (3.00kB)
FunctionType<'db>::signature_ 2.29MB 2.30MB +0.08% (1.78kB)
Type<'db>::try_call_dunder_get_ 5.49MB 5.49MB +0.03% (1.71kB)
Type<'db>::class_member_with_policy_ 7.84MB 7.84MB +0.02% (1.61kB)
check_file_impl 5.04MB 5.04MB +0.03% (1.36kB)
infer_unpack_types 467.98kB 469.22kB +0.27% (1.24kB)
Specialization 1.05MB 1.05MB +0.09% (1.00kB)
infer_deferred_types 5.89MB 5.89MB +0.02% (1016.00B)
CallableType 1.12MB 1.13MB +0.07% (864.00B)
... 26 more

trio

Name Old New Diff Outcome
infer_expression_types_impl 6.31MB 6.31MB +0.05% (2.92kB)
Type<'db>::member_lookup_with_policy_ 1.76MB 1.76MB -0.09% (1.68kB)
Type<'db>::member_lookup_with_policy_::interned_arguments 869.98kB 868.46kB -0.18% (1.52kB)
Type<'db>::apply_specialization_ 770.43kB 771.89kB +0.19% (1.45kB)
Type<'db>::apply_specialization_::interned_arguments 657.50kB 658.91kB +0.21% (1.41kB)
infer_scope_types_impl 5.48MB 5.48MB +0.01% (732.00B)
infer_deferred_types 2.47MB 2.47MB +0.03% (712.00B)
Specialization 485.72kB 486.41kB +0.14% (704.00B)
FunctionType<'db>::signature_ 1.07MB 1.07MB +0.06% (688.00B)
StaticClassLiteral<'db>::try_mro_ 886.75kB 887.39kB +0.07% (652.00B)
Type<'db>::try_call_dunder_get_ 1.52MB 1.52MB +0.03% (556.00B)
is_redundant_with_impl::interned_arguments 557.39kB 557.91kB +0.09% (528.00B)
IntersectionType 251.28kB 251.67kB +0.16% (400.00B)
is_redundant_with_impl 484.93kB 485.24kB +0.06% (312.00B)
infer_definition_types 7.80MB 7.80MB -0.00% (288.00B)
... 15 more

flake8

Name Old New Diff Outcome
enum_metadata 56.43kB 56.87kB +0.78% (452.00B)
infer_deferred_types 727.66kB 727.96kB +0.04% (304.00B)
FunctionType<'db>::signature_ 361.43kB 361.72kB +0.08% (296.00B)
Type<'db>::member_lookup_with_policy_::interned_arguments 207.80kB 207.59kB -0.10% (208.00B)
IntersectionType 81.79kB 81.98kB +0.24% (200.00B)
Type<'db>::member_lookup_with_policy_ 426.83kB 426.64kB -0.04% (192.00B)
is_redundant_with_impl::interned_arguments 154.86kB 155.03kB +0.11% (176.00B)
infer_expression_types_impl 1.12MB 1.12MB +0.01% (144.00B)
is_redundant_with_impl 150.02kB 150.12kB +0.06% (96.00B)

@carljm carljm marked this pull request as ready for review February 15, 2026 04:53
* main:
  Update ecosystem-analyzer to latest commit (#23287)
  [ty] support narrowing from Callable returning type guard (#23280)
  [ty] Update CONFORMANCE_SUITE_COMMIT to new hash (#23276)
  [ty] Sync vendored typeshed stubs (#23279)
Copy link
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.

Awesome!

This is a test-only review so far. There are a few tests that don't test what they say they're testing.

Copy link
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.

(still not a complete review -- will pick it back up tomorrow!)

Copy link
Contributor Author

@carljm carljm left a comment

Choose a reason for hiding this comment

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

Thanks for the review!

# Diagnostics

```
error[invalid-argument-type]: Argument to bound method `__call__` is incorrect
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This looks verbose in this contrived example, but I think in real code it's pretty unlikely to call a union containing an intersection where all elements of the union and the intersection all fail the call, and all elements of the intersection have the same "priority" error. And if that did happen, you might well want to know the details on each failed element.

@carljm carljm requested a review from AlexWaygood February 16, 2026 01:02
@AlexWaygood AlexWaygood self-assigned this Feb 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ecosystem-analyzer ty Multi-file analysis & type inference

Projects

None yet

Development

Successfully merging this pull request may close these issues.

support calls to intersection types

3 participants