Skip to content

[ty] support implicit recursive union type aliases - #22238

Draft
mtshiba wants to merge 46 commits into
astral-sh:mainfrom
mtshiba:implicit-recursive-union
Draft

[ty] support implicit recursive union type aliases#22238
mtshiba wants to merge 46 commits into
astral-sh:mainfrom
mtshiba:implicit-recursive-union

Conversation

@mtshiba

@mtshiba mtshiba commented Dec 29, 2025

Copy link
Copy Markdown
Collaborator

Summary

Part of astral-sh/ty#1738

This PR allows implicit (or PEP-613) union type aliases to be self-referential.
To achieve this, two new Rust structs are added: LazyUnionTypeInstance and ImplicitTypeAliasType.
As a result, the previous UnionTypeInstance is now called EagerUnionTypeInstance. Also, an Implicit(ImplicitTypeAliasType) variant is added to TypeAliasType.

First, a union type instance is created as EagerUnionTypeInstance. Then, when registering a binding, it is checked whether it can be promoted to LazyUnionTypeInstance. The promotion criteria include whether it is a valid union type and whether it is a non-generic type (this should be relaxed in the future, but is marked as TODO for this PR).

JsonValue = Union[int, float, bool, str, None, dict[str, "JsonValue"], list["JsonValue"]]
# ↑ Lazy      ↑ Eager                                     ↑ Lazy             ↑ Lazy
typing.cast(Union[int, str], x)
#             ↑ Eager

LazyUnionTypeInstance is converted to ImplicitTypeAliasType in a type context. ImplicitTypeAliasType behaves almost identically to PEP-695 type alias (except that it doesn't have a generic context yet).
There are other KnownInstances that can be converted to ImplicitTypeAliasType in a type context, but in this PR we will focus on union type instances.

Also, this change means that implicit type aliases are now shown with their name rather than their expanded type.
This is preferable, assuming there is reasonable intent behind the naming of type aliases.

Fixes astral-sh/ty#1883 (with #22241)
Fixes astral-sh/ty#1998

Performance analysis

#22238 (comment)

Ecosystem analysis

The new false positive errors appears to be due to astral-sh/ty#2015. Type aliases should basically behave the same as value types, but as in astral-sh/ty#2015, inconsistencies in behavior have been observed in implementations, which may also affect performance.

Test Plan

New corpus test
mdtest updated

@mtshiba mtshiba added ty Multi-file analysis & type inference ecosystem-analyzer labels Dec 29, 2025
@astral-sh-bot

astral-sh-bot Bot commented Dec 29, 2025

Copy link
Copy Markdown

Typing conformance results improved 🎉

The percentage of diagnostics emitted that were expected errors increased from 88.79% to 88.87%. The percentage of expected errors that received a diagnostic increased from 84.63% to 85.29%. The number of fully passing files held steady at 84/134.

Summary

How are test cases classified?

Each test case represents one expected error annotation or a group of annotations sharing a tag. Counts are per test case, not per diagnostic — multiple diagnostics on the same line count as one. Required annotations (E) are true positives when ty flags the expected location and false negatives when it does not. Optional annotations (E?) are true positives when flagged but true negatives (not false negatives) when not. Tagged annotations (E[tag]) require ty to flag exactly one of the tagged lines; tagged multi-annotations (E[tag+]) allow any number up to the tag count. Flagging unexpected locations counts as a false positive.

Metric Old New Diff Outcome
True Positives 903 910 +7 ⏫ (✅)
False Positives 114 114 +0
False Negatives 164 157 -7 ⏬ (✅)
Total Diagnostics 1067 1074 +7
Precision 88.79% 88.87% +0.08% ⏫ (✅)
Recall 84.63% 85.29% +0.66% ⏫ (✅)
Passing Files 84/134 84/134 +0

Test file breakdown

1 file altered
File True Positives False Positives False Negatives Status
aliases_recursive.py 7 (+7) ✅ 0 4 (-7) ✅ 📈 Improving
Total (all files) 910 (+7) ✅ 114 157 (-7) ✅ 84/134

True positives added (7)

7 diagnostics
Test case Diff

aliases_recursive.py:19

+error[invalid-assignment] Object of type `dict[str, str | None | int | ... omitted 4 union elements]` is not assignable to `Json`

aliases_recursive.py:20

+error[invalid-assignment] Object of type `list[None | int | str | ... omitted 4 union elements]` is not assignable to `Json`

aliases_recursive.py:38

+error[invalid-assignment] Object of type `tuple[Literal[1], tuple[Literal["1"], Literal[1]], tuple[Literal[1], tuple[Literal[1], list[int]]]]` is not assignable to `RecursiveTuple`

aliases_recursive.py:39

+error[invalid-assignment] Object of type `tuple[Literal[1], list[int]]` is not assignable to `RecursiveTuple`

aliases_recursive.py:50

+error[invalid-assignment] Object of type `dict[str, list[int]]` is not assignable to `RecursiveMapping`

aliases_recursive.py:51

+error[invalid-assignment] Object of type `dict[str, str | int | list[int]]` is not assignable to `RecursiveMapping`

aliases_recursive.py:52

+error[invalid-assignment] Object of type `dict[str, str | int | dict[str, str | int | list[int]]]` is not assignable to `RecursiveMapping`

True positives changed (11)

11 diagnostics
Test case Diff

aliases_explicit.py:102

-error[not-subscriptable] Cannot subscript non-generic type `<types.UnionType special-form 'list[Unknown] | set[Unknown]'>`
+error[not-subscriptable] Cannot subscript non-generic type `<types.UnionType special-form 'ListOrSetAlias'>`

aliases_explicit.py:67

-error[not-subscriptable] Cannot subscript non-generic type `<types.UnionType special-form 'int | None'>`
+error[not-subscriptable] Cannot subscript non-generic type `<types.UnionType special-form 'GoodTypeAlias2'>`

aliases_explicit.py:68

-error[not-subscriptable] Cannot subscript non-generic type `<class 'list[int | None]'>`
+error[not-subscriptable] Cannot subscript non-generic type `<class 'list[GoodTypeAlias2]'>`

aliases_implicit.py:135

-error[not-subscriptable] Cannot subscript non-generic type `<types.UnionType special-form 'list[Unknown] | set[Unknown]'>`
+error[not-subscriptable] Cannot subscript non-generic type `<types.UnionType special-form 'ListOrSetAlias'>`

aliases_implicit.py:76

-error[not-subscriptable] Cannot subscript non-generic type `<types.UnionType special-form 'int | None'>`
+error[not-subscriptable] Cannot subscript non-generic type `<types.UnionType special-form 'GoodTypeAlias2'>`

aliases_implicit.py:77

-error[not-subscriptable] Cannot subscript non-generic type `<class 'list[int | None]'>`
+error[not-subscriptable] Cannot subscript non-generic type `<class 'list[GoodTypeAlias2]'>`

aliases_newtype.py:23

-error[invalid-argument-type] Argument to function `isinstance` is incorrect: Expected `type | UnionType | tuple[Divergent, ...]`, found `<NewType pseudo-class 'UserId'>`
+error[invalid-argument-type] Argument to function `isinstance` is incorrect: Expected `_ClassInfo`, found `<NewType pseudo-class 'UserId'>`

aliases_type_statement.py:31

-error[invalid-argument-type] Argument to function `isinstance` is incorrect: Expected `type | UnionType | tuple[Divergent, ...]`, found `TypeAliasType`
+error[invalid-argument-type] Argument to function `isinstance` is incorrect: Expected `_ClassInfo`, found `TypeAliasType`

tuples_type_compat.py:75

-error[type-assertion-failure] Type `tuple[int] | tuple[str, str] | tuple[int, *tuple[str, ...], int]` does not match asserted type `tuple[int]`
+error[type-assertion-failure] Type `Func5Input` does not match asserted type `tuple[int]`

tuples_type_compat.py:80

-error[type-assertion-failure] Type `tuple[int] | tuple[str, str] | tuple[int, *tuple[str, ...], int]` does not match asserted type `tuple[str, str] | tuple[int, int]`
+error[type-assertion-failure] Type `Func5Input` does not match asserted type `tuple[str, str] | tuple[int, int]`

tuples_type_compat.py:85

-error[type-assertion-failure] Type `tuple[int] | tuple[str, str] | tuple[int, *tuple[str, ...], int]` does not match asserted type `tuple[int, str, int]`
+error[type-assertion-failure] Type `Func5Input` does not match asserted type `tuple[int, str, int]`

False positives changed (1)

1 diagnostic
Test case Diff

typeforms_typeform.py:31

-error[type-assertion-failure] Type `<types.UnionType special-form 'int | str'>` does not match asserted type `Unknown`
-error[invalid-type-form] Invalid subscript of object of type `_SpecialForm` in a type expression
+error[type-assertion-failure] Type `<types.UnionType special-form 'v_any'>` does not match asserted type `Unknown`
+error[invalid-type-form] Invalid subscript of object of type `_SpecialForm` in a type expression

@astral-sh-bot

astral-sh-bot Bot commented Dec 29, 2025

Copy link
Copy Markdown

mypy_primer results

Changes were detected when running on open source projects
more-itertools (https://github.com/more-itertools/more-itertools)
- more_itertools/recipes.py:1098:18: error[invalid-argument-type] Argument to function `__new__` is incorrect: Expected `(int | float | complex | _SupportsPow2[Any, Any] | _SupportsPow3[Any, Any, Any], int | float | complex | _SupportsPow2[Any, Any] | _SupportsPow3[Any, Any, Any], /) -> int | float | complex | ... omitted 3 union elements`, found `Overload[(base: int, exp: int, mod: int) -> int, (base: int, exp: Literal[0], mod: None = None) -> Literal[1], (base: int, exp: Literal[1, 2, 3, 4, 5, ... omitted 20 literals], mod: None = None) -> int, (base: int, exp: Literal[-1, -2, -3, -4, -5, ... omitted 15 literals], mod: None = None) -> int | float, (base: int, exp: int, mod: None = None) -> Any, (base: Literal[1, 2, 3, 4, 5, ... omitted 20 literals], exp: int | float, mod: None = None) -> int | float, (base: Literal[-1, -2, -3, -4, -5, ... omitted 15 literals], exp: int | float, mod: None = None) -> int | float | complex, (base: int | float, exp: int, mod: None = None) -> int | float, (base: int | float, exp: int | float | complex | _SupportsPow2[Any, Any] | _SupportsPow3[Any, Any, Any], mod: None = None) -> Any, (base: int | float | complex, exp: int | float | complex | _SupportsPow2[Any, Any] | _SupportsPow3[Any, Any, Any], mod: None = None) -> int | float | complex, [_E_contra, _T_co](base: _SupportsPow2[_E_contra, _T_co], exp: _E_contra, mod: None = None) -> _T_co, [_E_contra, _T_co](base: _SupportsPow3NoneOnly[_E_contra, _T_co], exp: _E_contra, mod: None = None) -> _T_co, [_E_contra, _M_contra, _T_co](base: _SupportsPow3[_E_contra, _M_contra, _T_co], exp: _E_contra, mod: _M_contra) -> _T_co, (base: _SupportsPow2[Any, Any] | _SupportsPow3[Any, Any, Any], exp: int | float, mod: None = None) -> Any, (base: _SupportsPow2[Any, Any] | _SupportsPow3[Any, Any, Any], exp: int | float | complex, mod: None = None) -> int | float | complex]`
+ more_itertools/recipes.py:1098:18: error[invalid-argument-type] Argument to function `__new__` is incorrect: Expected `(int | float | complex | _SupportsPow2[Any, Any] | _SupportsPow3[Any, Any, Any], int | float | complex | _SupportsPow2[Any, Any] | _SupportsPow3[Any, Any, Any], /) -> int | float | complex | ... omitted 3 union elements`, found `Overload[(base: int, exp: int, mod: int) -> int, (base: int, exp: Literal[0], mod: None = None) -> Literal[1], (base: int, exp: Literal[1, 2, 3, 4, 5, ... omitted 20 literals], mod: None = None) -> int, (base: int, exp: Literal[-1, -2, -3, -4, -5, ... omitted 15 literals], mod: None = None) -> int | float, (base: int, exp: int, mod: None = None) -> Any, (base: Literal[1, 2, 3, 4, 5, ... omitted 20 literals], exp: int | float, mod: None = None) -> int | float, (base: Literal[-1, -2, -3, -4, -5, ... omitted 15 literals], exp: int | float, mod: None = None) -> int | float | complex, (base: int | float, exp: int, mod: None = None) -> int | float, (base: int | float, exp: int | float | complex | _SupportsSomeKindOfPow, mod: None = None) -> Any, (base: int | float | complex, exp: int | float | complex | _SupportsSomeKindOfPow, mod: None = None) -> int | float | complex, [_E_contra, _T_co](base: _SupportsPow2[_E_contra, _T_co], exp: _E_contra, mod: None = None) -> _T_co, [_E_contra, _T_co](base: _SupportsPow3NoneOnly[_E_contra, _T_co], exp: _E_contra, mod: None = None) -> _T_co, [_E_contra, _M_contra, _T_co](base: _SupportsPow3[_E_contra, _M_contra, _T_co], exp: _E_contra, mod: _M_contra) -> _T_co, (base: _SupportsSomeKindOfPow, exp: int | float, mod: None = None) -> Any, (base: _SupportsSomeKindOfPow, exp: int | float | complex, mod: None = None) -> int | float | complex]`

attrs (https://github.com/python-attrs/attrs)
- src/attr/validators.py:175:24: error[invalid-argument-type] Argument to function `sorted` is incorrect: Argument type `(Overload[(pattern: str | Pattern[str], string: str, flags: int = 0) -> Match[str] | None, (pattern: bytes | Pattern[bytes], string: Buffer, flags: int = 0) -> Match[bytes] | None] & ~AlwaysTruthy & ~AlwaysFalsy) | (str & ~AlwaysFalsy)` does not satisfy upper bound `SupportsDunderLT[Any] | SupportsDunderGT[Any]` of type variable `SupportsRichComparisonT`
+ src/attr/validators.py:175:24: error[invalid-argument-type] Argument to function `sorted` is incorrect: Argument type `(Overload[(pattern: str | Pattern[str], string: str, flags: _FlagsType = 0) -> Match[str] | None, (pattern: bytes | Pattern[bytes], string: Buffer, flags: _FlagsType = 0) -> Match[bytes] | None] & ~AlwaysTruthy & ~AlwaysFalsy) | (str & ~AlwaysFalsy)` does not satisfy upper bound `SupportsRichComparison` of type variable `SupportsRichComparisonT`
- tests/test_converters.py:239:16: error[unresolved-attribute] Object of type `((Any, /) -> Any) | Converter[Any, Any]` has no attribute `converter`
+ tests/test_converters.py:239:16: error[unresolved-attribute] Object of type `_ConverterType` has no attribute `converter`
- tests/test_converters.py:240:16: error[unresolved-attribute] Object of type `((Any, /) -> Any) | Converter[Any, Any]` has no attribute `converter`
+ tests/test_converters.py:240:16: error[unresolved-attribute] Object of type `_ConverterType` has no attribute `converter`
- tests/test_converters.py:309:24: error[unresolved-attribute] Object of type `((Any, /) -> Any) | Converter[Any, Any]` has no attribute `converter`
+ tests/test_converters.py:309:24: error[unresolved-attribute] Object of type `_ConverterType` has no attribute `converter`
- tests/test_converters.py:319:16: error[unresolved-attribute] Object of type `((Any, /) -> Any) | Converter[Any, Any]` has no attribute `converter`
+ tests/test_converters.py:319:16: error[unresolved-attribute] Object of type `_ConverterType` has no attribute `converter`
- tests/test_converters.py:320:16: error[unresolved-attribute] Object of type `((Any, /) -> Any) | Converter[Any, Any]` has no attribute `converter`
+ tests/test_converters.py:320:16: error[unresolved-attribute] Object of type `_ConverterType` has no attribute `converter`
- tests/test_validators.py:185:68: error[invalid-argument-type] Argument to function `matches_re` is incorrect: Expected `((str | bytes, str | bytes, int, /) -> Match[str | bytes] | None) | None`, found `Overload[(pattern: str | Pattern[str], string: str, flags: int = 0) -> Match[str] | None, (pattern: bytes | Pattern[bytes], string: Buffer, flags: int = 0) -> Match[bytes] | None]`
+ tests/test_validators.py:185:68: error[invalid-argument-type] Argument to function `matches_re` is incorrect: Expected `((str | bytes, str | bytes, int, /) -> Match[str | bytes] | None) | None`, found `Overload[(pattern: str | Pattern[str], string: str, flags: _FlagsType = 0) -> Match[str] | None, (pattern: bytes | Pattern[bytes], string: Buffer, flags: _FlagsType = 0) -> Match[bytes] | None]`
- tests/test_validators.py:219:56: error[invalid-argument-type] Argument to function `matches_re` is incorrect: Expected `((str | bytes, str | bytes, int, /) -> Match[str | bytes] | None) | None`, found `Overload[(pattern: str | Pattern[str], string: str, flags: int = 0) -> Match[str] | None, (pattern: bytes | Pattern[bytes], string: Buffer, flags: int = 0) -> Match[bytes] | None]`
+ tests/test_validators.py:219:56: error[invalid-argument-type] Argument to function `matches_re` is incorrect: Expected `((str | bytes, str | bytes, int, /) -> Match[str | bytes] | None) | None`, found `Overload[(pattern: str | Pattern[str], string: str, flags: _FlagsType = 0) -> Match[str] | None, (pattern: bytes | Pattern[bytes], string: Buffer, flags: _FlagsType = 0) -> Match[bytes] | None]`
- typing-examples/mypy.py:250:64: error[invalid-argument-type] Argument to function `matches_re` is incorrect: Expected `((str | bytes, str | bytes, int, /) -> Match[str | bytes] | None) | None`, found `Overload[(pattern: str | Pattern[str], string: str, flags: int = 0) -> Match[str] | None, (pattern: bytes | Pattern[bytes], string: Buffer, flags: int = 0) -> Match[bytes] | None]`
+ typing-examples/mypy.py:250:64: error[invalid-argument-type] Argument to function `matches_re` is incorrect: Expected `((str | bytes, str | bytes, int, /) -> Match[str | bytes] | None) | None`, found `Overload[(pattern: str | Pattern[str], string: str, flags: _FlagsType = 0) -> Match[str] | None, (pattern: bytes | Pattern[bytes], string: Buffer, flags: _FlagsType = 0) -> Match[bytes] | None]`

packaging (https://github.com/pypa/packaging)
+ src/packaging/markers.py:144:46: warning[possibly-missing-attribute] Attribute `value` may be missing on object of type `Variable | Value | tuple[MarkerVar, Op, MarkerVar] | Sequence[Any]`
+ src/packaging/markers.py:147:46: warning[possibly-missing-attribute] Attribute `value` may be missing on object of type `Variable | Value | tuple[MarkerVar, Op, MarkerVar] | Sequence[Any]`
+ src/packaging/markers.py:149:12: error[invalid-return-type] Return type does not match returned value: expected `list[Divergent] | MarkerAtom | str`, found `tuple[Variable | Value | tuple[MarkerVar, Op, MarkerVar] | Sequence[Any], Op | tuple[MarkerVar, Op, MarkerVar] | Sequence[Any], Variable | Value | tuple[MarkerVar, Op, MarkerVar] | Sequence[Any]]`
+ src/packaging/markers.py:183:26: warning[possibly-missing-attribute] Attribute `serialize` may be missing on object of type `MarkerVar | Op | tuple[MarkerVar, Op, MarkerVar] | Sequence[Any]`
- Found 24 diagnostics
+ Found 28 diagnostics

aioredis (https://github.com/aio-libs/aioredis)
+ aioredis/client.py:1596:29: error[invalid-argument-type] Argument to function `list_or_args` is incorrect: Argument type `KeysT` does not satisfy upper bound `_StringLikeT` of type variable `_KeyT`
+ aioredis/client.py:1921:37: error[invalid-argument-type] Argument to function `list_or_args` is incorrect: Argument type `KeysT` does not satisfy upper bound `_StringLikeT` of type variable `_KeyT`
+ aioredis/client.py:2160:60: error[invalid-argument-type] Argument to function `list_or_args` is incorrect: Argument type `KeysT` does not satisfy upper bound `_StringLikeT` of type variable `_KeyT`
+ aioredis/client.py:2173:60: error[invalid-argument-type] Argument to function `list_or_args` is incorrect: Argument type `KeysT` does not satisfy upper bound `_StringLikeT` of type variable `_KeyT`
+ aioredis/client.py:2608:36: error[invalid-argument-type] Argument to function `list_or_args` is incorrect: Argument type `KeysT` does not satisfy upper bound `_StringLikeT` of type variable `_KeyT`
+ aioredis/client.py:2616:36: error[invalid-argument-type] Argument to function `list_or_args` is incorrect: Argument type `KeysT` does not satisfy upper bound `_StringLikeT` of type variable `_KeyT`
+ aioredis/client.py:2621:36: error[invalid-argument-type] Argument to function `list_or_args` is incorrect: Argument type `KeysT` does not satisfy upper bound `_StringLikeT` of type variable `_KeyT`
+ aioredis/client.py:2629:36: error[invalid-argument-type] Argument to function `list_or_args` is incorrect: Argument type `KeysT` does not satisfy upper bound `_StringLikeT` of type variable `_KeyT`
+ aioredis/client.py:2666:36: error[invalid-argument-type] Argument to function `list_or_args` is incorrect: Argument type `KeysT` does not satisfy upper bound `_StringLikeT` of type variable `_KeyT`
+ aioredis/client.py:2674:36: error[invalid-argument-type] Argument to function `list_or_args` is incorrect: Argument type `KeysT` does not satisfy upper bound `_StringLikeT` of type variable `_KeyT`
+ aioredis/client.py:3176:36: error[invalid-argument-type] Argument to function `list_or_args` is incorrect: Argument type `KeysT` does not satisfy upper bound `_StringLikeT` of type variable `_KeyT`
+ aioredis/client.py:3190:48: error[invalid-argument-type] Argument to function `list_or_args` is incorrect: Argument type `KeysT` does not satisfy upper bound `_StringLikeT` of type variable `_KeyT`
- aioredis/client.py:3430:34: error[invalid-assignment] Object of type `KeysView[object]` is not assignable to `Sequence[bytes | str | memoryview[int]] | AbstractSet[AnyKeyT@_zaggregate]`
+ aioredis/client.py:3430:34: error[invalid-assignment] Object of type `KeysView[object]` is not assignable to `Sequence[_StringLikeT] | AbstractSet[AnyKeyT@_zaggregate]`
- aioredis/client.py:4114:55: error[invalid-assignment] Object of type `dict[bytes | str | memoryview[int], Any | None]` is not assignable to `dict[bytes | str | memoryview[int], (dict[str, str], /) -> Awaitable[None]]`
+ aioredis/client.py:4114:55: error[invalid-assignment] Object of type `dict[_StringLikeT, Any | None]` is not assignable to `dict[_StringLikeT, (dict[str, str], /) -> Awaitable[None]]`
- aioredis/connection.py:441:16: error[invalid-return-type] Return type does not match returned value: expected `bytes | memoryview[int] | str | ... omitted 4 union elements`, found `int | list[Unknown | bytes | memoryview[int] | ... omitted 5 union elements] | bytes | ... omitted 3 union elements`
+ aioredis/connection.py:441:16: error[invalid-return-type] Return type does not match returned value: expected `EncodableT | ResponseError | None`, found `int | list[Unknown | bytes | memoryview[int] | ... omitted 5 union elements] | bytes | ... omitted 3 union elements`
- Found 29 diagnostics
+ Found 41 diagnostics

janus (https://github.com/aio-libs/janus)
- janus/__init__.py:714:18: error[invalid-argument-type] Argument to function `heappush` is incorrect: Argument type `T@PriorityQueue` does not satisfy upper bound `SupportsDunderLT[Any] | SupportsDunderGT[Any]` of type variable `SupportsRichComparisonT`
+ janus/__init__.py:714:18: error[invalid-argument-type] Argument to function `heappush` is incorrect: Argument type `T@PriorityQueue` does not satisfy upper bound `SupportsRichComparison` of type variable `SupportsRichComparisonT`
- janus/__init__.py:714:36: error[invalid-argument-type] Argument to function `heappush` is incorrect: Argument type `T@PriorityQueue` does not satisfy upper bound `SupportsDunderLT[Any] | SupportsDunderGT[Any]` of type variable `SupportsRichComparisonT`
+ janus/__init__.py:714:36: error[invalid-argument-type] Argument to function `heappush` is incorrect: Argument type `T@PriorityQueue` does not satisfy upper bound `SupportsRichComparison` of type variable `SupportsRichComparisonT`
- janus/__init__.py:717:24: error[invalid-argument-type] Argument to function `heappop` is incorrect: Argument type `T@PriorityQueue` does not satisfy upper bound `SupportsDunderLT[Any] | SupportsDunderGT[Any]` of type variable `SupportsRichComparisonT`
+ janus/__init__.py:717:24: error[invalid-argument-type] Argument to function `heappop` is incorrect: Argument type `T@PriorityQueue` does not satisfy upper bound `SupportsRichComparison` of type variable `SupportsRichComparisonT`

anyio (https://github.com/agronholm/anyio)
- src/anyio/_backends/_asyncio.py:360:34: error[invalid-argument-type] Argument to function `getcoroutinestate` is incorrect: Expected `Coroutine[Any, Any, Any]`, found `Generator[Future[object] | None, None, Unknown] | Coroutine[Any, Any, Unknown]`
+ src/anyio/_backends/_asyncio.py:360:34: error[invalid-argument-type] Argument to function `getcoroutinestate` is incorrect: Expected `Coroutine[Any, Any, Any]`, found `Generator[_TaskYieldType, None, Unknown] | Coroutine[Any, Any, Unknown]`
- src/anyio/_backends/_trio.py:1098:30: error[invalid-argument-type] Argument to function `convert_item` is incorrect: Expected `str | bytes | PathLike[str] | PathLike[bytes]`, found `str | bytes | (Sequence[str | bytes | PathLike[str] | PathLike[bytes]] & PathLike[object]) | PathLike[str] | PathLike[bytes]`
+ src/anyio/_backends/_trio.py:1098:30: error[invalid-argument-type] Argument to function `convert_item` is incorrect: Expected `StrOrBytesPath`, found `str | bytes | PathLike[str] | PathLike[bytes] | (Sequence[StrOrBytesPath] & PathLike[object])`

beartype (https://github.com/beartype/beartype)
- beartype/claw/_importlib/_clawimpload.py:379:9: error[invalid-assignment] Object of type `def cache_from_source_beartype(...) -> str` is not assignable to attribute `cache_from_source` of type `Overload[(path: str | PathLike[str], debug_override: bool, *, optimization: None = None) -> str, (path: str | PathLike[str], debug_override: None = None, *, optimization: Any | None = None) -> str]`
+ beartype/claw/_importlib/_clawimpload.py:379:9: error[invalid-assignment] Object of type `def cache_from_source_beartype(...) -> str` is not assignable to attribute `cache_from_source` of type `Overload[(path: StrPath, debug_override: bool, *, optimization: None = None) -> str, (path: StrPath, debug_override: None = None, *, optimization: Any | None = None) -> str]`

stone (https://github.com/dropbox/stone)
- stone/frontend/ir_generator.py:902:55: error[invalid-argument-type] Argument to function `__new__` is incorrect: Expected `str | Buffer | SupportsFloat | SupportsIndex`, found `TagRef | (Unknown & ~AstTagRef)`
+ stone/frontend/ir_generator.py:902:55: error[invalid-argument-type] Argument to function `__new__` is incorrect: Expected `ConvertibleToFloat`, found `TagRef | (Unknown & ~AstTagRef)`

bandersnatch (https://github.com/pypa/bandersnatch)
- src/bandersnatch/mirror.py:264:13: error[invalid-argument-type] Argument to function `max` is incorrect: Argument type `Unknown | int | None` does not satisfy upper bound `SupportsDunderLT[Any] | SupportsDunderGT[Any]` of type variable `SupportsRichComparisonT`
+ src/bandersnatch/mirror.py:264:13: error[invalid-argument-type] Argument to function `max` is incorrect: Argument type `Unknown | int | None` does not satisfy upper bound `SupportsRichComparison` of type variable `SupportsRichComparisonT`

yarl (https://github.com/aio-libs/yarl)
- tests/test_update_query.py:324:24: error[invalid-argument-type] Argument to bound method `with_query` is incorrect: Expected `None | str | Mapping[str, Sequence[str | SupportsInt] | SupportsInt] | Sequence[tuple[str, Sequence[str | SupportsInt] | SupportsInt]]`, found `memoryview[int]`
+ tests/test_update_query.py:324:24: error[invalid-argument-type] Argument to bound method `with_query` is incorrect: Expected `Query`, found `memoryview[int]`
- tests/test_url_query.py:231:26: error[invalid-argument-type] Argument to bound method `update_query` is incorrect: Expected `None | str | Mapping[str, Sequence[str | SupportsInt] | SupportsInt] | Sequence[tuple[str, Sequence[str | SupportsInt] | SupportsInt]]`, found `memoryview[int]`
+ tests/test_url_query.py:231:26: error[invalid-argument-type] Argument to bound method `update_query` is incorrect: Expected `Query`, found `memoryview[int]`
- yarl/_query.py:51:66: error[invalid-argument-type] Argument to function `query_var` is incorrect: Expected `str | SupportsInt`, found `object`
+ yarl/_query.py:51:66: error[invalid-argument-type] Argument to function `query_var` is incorrect: Expected `SimpleQuery`, found `object`

spack (https://github.com/spack/spack)
- lib/spack/spack/binary_distribution.py:2075:38: error[invalid-argument-type] Argument to function `__new__` is incorrect: Expected `str | PathLike[str]`, found `Sized`
+ lib/spack/spack/binary_distribution.py:2075:38: error[invalid-argument-type] Argument to function `__new__` is incorrect: Expected `StrPath`, found `Sized`
- lib/spack/spack/cmd/blame.py:158:38: error[invalid-argument-type] Argument to function `__new__` is incorrect: Expected `str | PathLike[str]`, found `object`
+ lib/spack/spack/cmd/blame.py:158:38: error[invalid-argument-type] Argument to function `__new__` is incorrect: Expected `StrPath`, found `object`
- lib/spack/spack/cmd/blame.py:168:38: error[invalid-argument-type] Argument to function `__new__` is incorrect: Expected `str | PathLike[str]`, found `object`
+ lib/spack/spack/cmd/blame.py:168:38: error[invalid-argument-type] Argument to function `__new__` is incorrect: Expected `StrPath`, found `object`
- lib/spack/spack/cmd/commands.py:563:34: error[invalid-argument-type] Argument to function `sorted` is incorrect: Argument type `object` does not satisfy upper bound `SupportsDunderLT[Any] | SupportsDunderGT[Any]` of type variable `SupportsRichComparisonT`
+ lib/spack/spack/cmd/commands.py:563:34: error[invalid-argument-type] Argument to function `sorted` is incorrect: Argument type `object` does not satisfy upper bound `SupportsRichComparison` of type variable `SupportsRichComparisonT`
- lib/spack/spack/cmd/diff.py:106:24: error[invalid-argument-type] Argument to function `sorted` is incorrect: Argument type `AspFunction` does not satisfy upper bound `SupportsDunderLT[Any] | SupportsDunderGT[Any]` of type variable `SupportsRichComparisonT`
+ lib/spack/spack/cmd/diff.py:106:24: error[invalid-argument-type] Argument to function `sorted` is incorrect: Argument type `AspFunction` does not satisfy upper bound `SupportsRichComparison` of type variable `SupportsRichComparisonT`
- lib/spack/spack/cmd/diff.py:107:30: error[invalid-argument-type] Argument to function `sorted` is incorrect: Argument type `AspFunction` does not satisfy upper bound `SupportsDunderLT[Any] | SupportsDunderGT[Any]` of type variable `SupportsRichComparisonT`
+ lib/spack/spack/cmd/diff.py:107:30: error[invalid-argument-type] Argument to function `sorted` is incorrect: Argument type `AspFunction` does not satisfy upper bound `SupportsRichComparison` of type variable `SupportsRichComparisonT`
- lib/spack/spack/cmd/diff.py:108:30: error[invalid-argument-type] Argument to function `sorted` is incorrect: Argument type `AspFunction` does not satisfy upper bound `SupportsDunderLT[Any] | SupportsDunderGT[Any]` of type variable `SupportsRichComparisonT`
+ lib/spack/spack/cmd/diff.py:108:30: error[invalid-argument-type] Argument to function `sorted` is incorrect: Argument type `AspFunction` does not satisfy upper bound `SupportsRichComparison` of type variable `SupportsRichComparisonT`
- lib/spack/spack/cmd/providers.py:59:40: error[invalid-argument-type] Argument to function `sorted` is incorrect: Argument type `Spec` does not satisfy upper bound `SupportsDunderLT[Any] | SupportsDunderGT[Any]` of type variable `SupportsRichComparisonT`
+ lib/spack/spack/cmd/providers.py:59:40: error[invalid-argument-type] Argument to function `sorted` is incorrect: Argument type `Spec` does not satisfy upper bound `SupportsRichComparison` of type variable `SupportsRichComparisonT`
- lib/spack/spack/config.py:1153:35: error[invalid-argument-type] Argument to function `isfile` is incorrect: Expected `int | str | bytes | PathLike[str] | PathLike[bytes]`, found `object`
+ lib/spack/spack/config.py:1153:35: error[invalid-argument-type] Argument to function `isfile` is incorrect: Expected `FileDescriptorOrPath`, found `object`
- lib/spack/spack/config.py:1155:34: error[invalid-argument-type] Argument to function `isdir` is incorrect: Expected `int | str | bytes | PathLike[str] | PathLike[bytes]`, found `object`
+ lib/spack/spack/config.py:1155:34: error[invalid-argument-type] Argument to function `isdir` is incorrect: Expected `FileDescriptorOrPath`, found `object`
- lib/spack/spack/directives.py:366:15: error[invalid-assignment] Object of type `list[object]` is not assignable to `((type[PackageBase] | Dependency, /) -> None) | str | list[((type[PackageBase] | Dependency, /) -> None) | str] | None`
+ lib/spack/spack/directives.py:366:15: error[invalid-assignment] Object of type `list[object]` is not assignable to `PatchesType | None`
+ lib/spack/spack/directives.py:367:37: error[not-iterable] Object of type `PatchesType | None` is not iterable
- lib/spack/spack/directives.py:367:37: error[not-iterable] Object of type `((type[PackageBase] | Dependency, /) -> None) | str | list[((type[PackageBase] | Dependency, /) -> None) | str] | None` may not be iterable
- lib/spack/spack/directives.py:391:26: error[not-iterable] Object of type `((type[PackageBase] | Dependency, /) -> None) | str | list[((type[PackageBase] | Dependency, /) -> None) | str] | None` may not be iterable
- lib/spack/spack/directives.py:392:9: error[call-non-callable] Object of type `str` is not callable
+ lib/spack/spack/directives.py:391:26: error[not-iterable] Object of type `PatchesType | None` is not iterable
- lib/spack/spack/installer.py:1309:27: error[invalid-argument-type] Argument to bound method `__call__` is incorrect: Expected `str | bytes | PathLike[str] | PathLike[bytes]`, found `Unknown | None | str`
+ lib/spack/spack/installer.py:1309:27: error[invalid-argument-type] Argument to bound method `__call__` is incorrect: Expected `StrOrBytesPath`, found `Unknown | None | str`
- lib/spack/spack/installer.py:1322:23: error[invalid-argument-type] Argument to function `rename` is incorrect: Expected `str | bytes | PathLike[str] | PathLike[bytes]`, found `Unknown | None | str`
+ lib/spack/spack/installer.py:1322:23: error[invalid-argument-type] Argument to function `rename` is incorrect: Expected `StrOrBytesPath`, found `Unknown | None | str`
- lib/spack/spack/llnl/util/filesystem.py:168:5: error[invalid-assignment] Object of type `def copystat(src, dst, follow_symlinks=True) -> Unknown` is not assignable to attribute `copystat` of type `def copystat(src: str | bytes | PathLike[str] | PathLike[bytes], dst: str | bytes | PathLike[str] | PathLike[bytes], *, follow_symlinks: bool = True) -> None`
+ lib/spack/spack/llnl/util/filesystem.py:168:5: error[invalid-assignment] Object of type `def copystat(src, dst, follow_symlinks=True) -> Unknown` is not assignable to attribute `copystat` of type `def copystat(src: StrOrBytesPath, dst: StrOrBytesPath, *, follow_symlinks: bool = True) -> None`
- lib/spack/spack/llnl/util/filesystem.py:1668:35: error[invalid-argument-type] Argument to function `exists` is incorrect: Expected `int | str | bytes | PathLike[str] | PathLike[bytes]`, found `Unknown | Sized`
+ lib/spack/spack/llnl/util/filesystem.py:1668:35: error[invalid-argument-type] Argument to function `exists` is incorrect: Expected `FileDescriptorOrPath`, found `Unknown | Sized`
- lib/spack/spack/llnl/util/filesystem.py:1674:25: error[invalid-argument-type] Argument to function `move` is incorrect: Expected `str | PathLike[str]`, found `Unknown | Sized`
+ lib/spack/spack/llnl/util/filesystem.py:1674:25: error[invalid-argument-type] Argument to function `move` is incorrect: Expected `StrPath`, found `Unknown | Sized`
- lib/spack/spack/package_base.py:1531:33: error[invalid-argument-type] Argument to function `sorted` is incorrect: Argument type `Spec` does not satisfy upper bound `SupportsDunderLT[Any] | SupportsDunderGT[Any]` of type variable `SupportsRichComparisonT`
+ lib/spack/spack/package_base.py:1531:33: error[invalid-argument-type] Argument to function `sorted` is incorrect: Argument type `Spec` does not satisfy upper bound `SupportsRichComparison` of type variable `SupportsRichComparisonT`
- lib/spack/spack/package_base.py:1539:84: error[invalid-argument-type] Argument to function `sorted` is incorrect: Argument type `Spec` does not satisfy upper bound `SupportsDunderLT[Any] | SupportsDunderGT[Any]` of type variable `SupportsRichComparisonT`
+ lib/spack/spack/package_base.py:1539:84: error[invalid-argument-type] Argument to function `sorted` is incorrect: Argument type `Spec` does not satisfy upper bound `SupportsRichComparison` of type variable `SupportsRichComparisonT`
- lib/spack/spack/solver/asp.py:2519:13: error[invalid-argument-type] Method `__getitem__` of type `bound method dict[GitVersion | StandardVersion, list[Provenance]].__getitem__(key: GitVersion | StandardVersion, /) -> list[Provenance]` cannot be called with key of type `ConcreteVersion` on object of type `dict[GitVersion | StandardVersion, list[Provenance]]`
+ lib/spack/spack/solver/asp.py:2519:13: error[invalid-argument-type] Method `__getitem__` of type `bound method dict[GitOrStandardVersion, list[Provenance]].__getitem__(key: GitOrStandardVersion, /) -> list[Provenance]` cannot be called with key of type `ConcreteVersion` on object of type `dict[GitOrStandardVersion, list[Provenance]]`
- lib/spack/spack/solver/asp.py:3270:21: error[invalid-argument-type] Method `__getitem__` of type `bound method dict[GitVersion | StandardVersion, list[Provenance]].__getitem__(key: GitVersion | StandardVersion, /) -> list[Provenance]` cannot be called with key of type `ConcreteVersion` on object of type `dict[GitVersion | StandardVersion, list[Provenance]]`
+ lib/spack/spack/solver/asp.py:3270:21: error[invalid-argument-type] Method `__getitem__` of type `bound method dict[GitOrStandardVersion, list[Provenance]].__getitem__(key: GitOrStandardVersion, /) -> list[Provenance]` cannot be called with key of type `ConcreteVersion` on object of type `dict[GitOrStandardVersion, list[Provenance]]`
- lib/spack/spack/test/cmd/deprecate.py:89:45: error[invalid-argument-type] Argument to function `sorted` is incorrect: Argument type `Spec` does not satisfy upper bound `SupportsDunderLT[Any] | SupportsDunderGT[Any]` of type variable `SupportsRichComparisonT`
+ lib/spack/spack/test/cmd/deprecate.py:89:45: error[invalid-argument-type] Argument to function `sorted` is incorrect: Argument type `Spec` does not satisfy upper bound `SupportsRichComparison` of type variable `SupportsRichComparisonT`
- lib/spack/spack/test/cmd/deprecate.py:90:41: error[invalid-argument-type] Argument to function `sorted` is incorrect: Argument type `Unknown | Spec` does not satisfy upper bound `SupportsDunderLT[Any] | SupportsDunderGT[Any]` of type variable `SupportsRichComparisonT`
+ lib/spack/spack/test/cmd/deprecate.py:90:41: error[invalid-argument-type] Argument to function `sorted` is incorrect: Argument type `Unknown | Spec` does not satisfy upper bound `SupportsRichComparison` of type variable `SupportsRichComparisonT`
- lib/spack/spack/test/directory_layout.py:116:30: error[invalid-argument-type] Argument to bound method `copy` is incorrect: Expected `int | str | list[str] | tuple[str, ...]`, found `SpecHashDescriptor`
+ lib/spack/spack/test/directory_layout.py:116:30: error[invalid-argument-type] Argument to bound method `copy` is incorrect: Expected `int | DepTypes`, found `SpecHashDescriptor`
- lib/spack/spack/test/directory_layout.py:129:37: error[invalid-argument-type] Argument to bound method `copy` is incorrect: Expected `int | str | list[str] | tuple[str, ...]`, found `SpecHashDescriptor`
+ lib/spack/spack/test/directory_layout.py:129:37: error[invalid-argument-type] Argument to bound method `copy` is incorrect: Expected `int | DepTypes`, found `SpecHashDescriptor`
- lib/spack/spack/test/directory_layout.py:134:70: error[invalid-argument-type] Argument to bound method `copy` is incorrect: Expected `int | str | list[str] | tuple[str, ...]`, found `SpecHashDescriptor`
+ lib/spack/spack/test/directory_layout.py:134:70: error[invalid-argument-type] Argument to bound method `copy` is incorrect: Expected `int | DepTypes`, found `SpecHashDescriptor`
- lib/spack/spack/test/llnl/util/lock.py:192:23: error[invalid-argument-type] Argument to bound method `__call__` is incorrect: Expected `str | bytes | PathLike[str] | PathLike[bytes]`, found `None | Unknown`
+ lib/spack/spack/test/llnl/util/lock.py:192:23: error[invalid-argument-type] Argument to bound method `__call__` is incorrect: Expected `StrOrBytesPath`, found `None | Unknown`
- lib/spack/spack/test/llnl/util/lock.py:1091:36: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `(() -> bool) | None | ContextManager[Unknown]`, found `def write(t, v, tb) -> Unknown`
- lib/spack/spack/test/llnl/util/lock.py:1093:40: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `(() -> bool) | None | ContextManager[Unknown]`, found `def write(t, v, tb) -> Unknown`
- lib/spack/spack/test/llnl/util/lock.py:1102:40: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `(() -> bool) | None | ContextManager[Unknown]`, found `def write(t, v, tb) -> Unknown`
- lib/spack/spack/test/llnl/util/lock.py:1108:36: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `(() -> bool) | None | ContextManager[Unknown]`, found `def write(t, v, tb) -> Unknown`
- lib/spack/spack/test/llnl/util/lock.py:1112:44: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `(() -> bool) | None | ContextManager[Unknown]`, found `def write(t, v, tb) -> Unknown`
- lib/spack/spack/test/llnl/util/lock.py:1121:40: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `(() -> bool) | None | ContextManager[Unknown]`, found `def write(t, v, tb) -> Unknown`
- lib/spack/spack/test/llnl/util/lock.py:1125:48: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `(() -> bool) | None | ContextManager[Unknown]`, found `def write(t, v, tb) -> Unknown`
+ lib/spack/spack/test/llnl/util/lock.py:1091:36: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `ReleaseFnType | ContextManager[Unknown]`, found `def write(t, v, tb) -> Unknown`
+ lib/spack/spack/test/llnl/util/lock.py:1093:40: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `ReleaseFnType | ContextManager[Unknown]`, found `def write(t, v, tb) -> Unknown`
+ lib/spack/spack/test/llnl/util/lock.py:1102:40: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `ReleaseFnType | ContextManager[Unknown]`, found `def write(t, v, tb) -> Unknown`
+ lib/spack/spack/test/llnl/util/lock.py:1108:36: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `ReleaseFnType | ContextManager[Unknown]`, found `def write(t, v, tb) -> Unknown`
+ lib/spack/spack/test/llnl/util/lock.py:1112:44: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `ReleaseFnType | ContextManager[Unknown]`, found `def write(t, v, tb) -> Unknown`
+ lib/spack/spack/test/llnl/util/lock.py:1121:40: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `ReleaseFnType | ContextManager[Unknown]`, found `def write(t, v, tb) -> Unknown`
+ lib/spack/spack/test/llnl/util/lock.py:1125:48: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `ReleaseFnType | ContextManager[Unknown]`, found `def write(t, v, tb) -> Unknown`
- lib/spack/spack/test/spec_dag.py:815:32: error[invalid-argument-type] Argument to function `canonicalize` is incorrect: Expected `str | list[str] | tuple[str, ...]`, found `def all(iterable: Iterable[object], /) -> bool`
+ lib/spack/spack/test/spec_dag.py:815:32: error[invalid-argument-type] Argument to function `canonicalize` is incorrect: Expected `DepTypes`, found `def all(iterable: Iterable[object], /) -> bool`
- lib/spack/spack/test/spec_dag.py:819:29: error[invalid-argument-type] Argument to function `canonicalize` is incorrect: Expected `str | list[str] | tuple[str, ...]`, found `None`
+ lib/spack/spack/test/spec_dag.py:819:29: error[invalid-argument-type] Argument to function `canonicalize` is incorrect: Expected `DepTypes`, found `None`
- lib/spack/spack/test/spec_dag.py:821:29: error[invalid-argument-type] Argument to function `canonicalize` is incorrect: Expected `str | list[str] | tuple[str, ...]`, found `list[str | None]`
+ lib/spack/spack/test/spec_dag.py:821:29: error[invalid-argument-type] Argument to function `canonicalize` is incorrect: Expected `DepTypes`, found `list[Unknown | None]`
- lib/spack/spack/test/spec_semantics.py:2121:19: error[invalid-argument-type] Argument to function `sorted` is incorrect: Argument type `Unknown | Spec` does not satisfy upper bound `SupportsDunderLT[Any] | SupportsDunderGT[Any]` of type variable `SupportsRichComparisonT`
+ lib/spack/spack/test/spec_semantics.py:2121:19: error[invalid-argument-type] Argument to function `sorted` is incorrect: Argument type `Unknown | Spec` does not satisfy upper bound `SupportsRichComparison` of type variable `SupportsRichComparisonT`
- lib/spack/spack/vendor/attr/validators.py:186:25: error[invalid-argument-type] Argument to function `sorted` is incorrect: Argument type `(Overload[(pattern: str | Pattern[str], string: str, flags: int = 0) -> Match[str] | None, (pattern: bytes | Pattern[bytes], string: Buffer, flags: int = 0) -> Match[bytes] | None] & ~AlwaysTruthy & ~AlwaysFalsy) | (str & ~AlwaysFalsy)` does not satisfy upper bound `SupportsDunderLT[Any] | SupportsDunderGT[Any]` of type variable `SupportsRichComparisonT`
+ lib/spack/spack/vendor/attr/validators.py:186:25: error[invalid-argument-type] Argument to function `sorted` is incorrect: Argument type `(Overload[(pattern: str | Pattern[str], string: str, flags: _FlagsType = 0) -> Match[str] | None, (pattern: bytes | Pattern[bytes], string: Buffer, flags: _FlagsType = 0) -> Match[bytes] | None] & ~AlwaysTruthy & ~AlwaysFalsy) | (str & ~AlwaysFalsy)` does not satisfy upper bound `SupportsRichComparison` of type variable `SupportsRichComparisonT`
- Found 4338 diagnostics
+ Found 4337 diagnostics

pip (https://github.com/pypa/pip)
- src/pip/_internal/metadata/pkg_resources.py:128:13: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `IResourceProvider | None`, found `InMemoryMetadata`
+ src/pip/_internal/metadata/pkg_resources.py:128:13: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `_MetadataType`, found `InMemoryMetadata`
- src/pip/_internal/metadata/pkg_resources.py:149:13: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `IResourceProvider | None`, found `InMemoryMetadata`
+ src/pip/_internal/metadata/pkg_resources.py:149:13: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `_MetadataType`, found `InMemoryMetadata`
- src/pip/_vendor/distlib/util.py:1473:41: error[invalid-argument-type] Argument to bound method `load_cert_chain` is incorrect: Expected `str | bytes | PathLike[str] | PathLike[bytes]`, found `str | bytes | PathLike[str] | PathLike[bytes] | None`
+ src/pip/_vendor/distlib/util.py:1473:41: error[invalid-argument-type] Argument to bound method `load_cert_chain` is incorrect: Expected `StrOrBytesPath`, found `str | bytes | PathLike[str] | PathLike[bytes] | None`
+ src/pip/_vendor/packaging/markers.py:139:46: warning[possibly-missing-attribute] Attribute `value` may be missing on object of type `Variable | Value | tuple[MarkerVar, Op, MarkerVar] | Sequence[Any]`
+ src/pip/_vendor/packaging/markers.py:142:46: warning[possibly-missing-attribute] Attribute `value` may be missing on object of type `Variable | Value | tuple[MarkerVar, Op, MarkerVar] | Sequence[Any]`
+ src/pip/_vendor/packaging/markers.py:144:12: error[invalid-return-type] Return type does not match returned value: expected `list[Divergent] | MarkerAtom | str`, found `tuple[Variable | Value | tuple[MarkerVar, Op, MarkerVar] | Sequence[Any], Op | tuple[MarkerVar, Op, MarkerVar] | Sequence[Any], Variable | Value | tuple[MarkerVar, Op, MarkerVar] | Sequence[Any]]`
+ src/pip/_vendor/packaging/markers.py:178:26: warning[possibly-missing-attribute] Attribute `serialize` may be missing on object of type `MarkerVar | Op | tuple[MarkerVar, Op, MarkerVar] | Sequence[Any]`
- src/pip/_vendor/pkg_resources/__init__.py:3466:40: error[invalid-argument-type] Argument to bound method `contains` is incorrect: Expected `Version | str`, found `(str & ~Distribution) | (tuple[str, ...] & ~Distribution) | Unknown`
+ src/pip/_vendor/pkg_resources/__init__.py:3466:40: error[invalid-argument-type] Argument to bound method `contains` is incorrect: Expected `UnparsedVersion`, found `(str & ~Distribution) | (tuple[str, ...] & ~Distribution) | Unknown`
- src/pip/_vendor/pyproject_hooks/_in_process/__init__.py:14:31: error[invalid-argument-type] Argument to function `path` is incorrect: Expected `str | ModuleType`, found `str | None`
+ src/pip/_vendor/pyproject_hooks/_in_process/__init__.py:14:31: error[invalid-argument-type] Argument to function `path` is incorrect: Expected `Package`, found `str | None`
- src/pip/_vendor/pyproject_hooks/_in_process/__init__.py:20:29: error[invalid-argument-type] Argument to function `files` is incorrect: Expected `str | ModuleType`, found `str | None`
+ src/pip/_vendor/pyproject_hooks/_in_process/__init__.py:20:29: error[invalid-argument-type] Argument to function `files` is incorrect: Expected `Package`, found `str | None`
+ src/pip/_vendor/rich/control.py:64:13: error[invalid-argument-type] Method `__getitem__` of type `bound method dict[int, (...) -> str].__getitem__(key: int, /) -> (...) -> str` cannot be called with key of type `str` on object of type `dict[int, (...) -> str]`
- src/pip/_vendor/rich/table.py:359:5: error[invalid-argument-type] Argument to bound method `setter` is incorrect: Expected `(Any, Any, /) -> None`, found `def padding(self, padding: int | tuple[int] | tuple[int, int] | tuple[int, int, int, int]) -> Table`
+ src/pip/_vendor/rich/table.py:359:5: error[invalid-argument-type] Argument to bound method `setter` is incorrect: Expected `(Any, Any, /) -> None`, found `def padding(self, padding: PaddingDimensions) -> Table`
- src/pip/_vendor/urllib3/contrib/securetransport.py:671:31: error[invalid-argument-type] Argument to bound method `__call__` is incorrect: Expected `str | bytes | PathLike[str] | PathLike[bytes]`, found `Unknown | None`
+ src/pip/_vendor/urllib3/contrib/securetransport.py:671:31: error[invalid-argument-type] Argument to bound method `__call__` is incorrect: Expected `StrOrBytesPath`, found `Unknown | None`
- src/pip/_vendor/urllib3/util/ssl_.py:182:62: error[invalid-argument-type] Argument to function `wrap_socket` is incorrect: Expected `str | bytes | PathLike[str] | PathLike[bytes] | None`, found `Unknown | None | VerifyMode | bool`
- src/pip/_vendor/urllib3/util/ssl_.py:182:62: error[invalid-argument-type] Argument to function `wrap_socket` is incorrect: Expected `str | bytes | PathLike[str] | PathLike[bytes] | None`, found `Unknown | None | VerifyMode | bool`
+ src/pip/_vendor/urllib3/util/ssl_.py:182:62: error[invalid-argument-type] Argument to function `wrap_socket` is incorrect: Expected `StrOrBytesPath | None`, found `Unknown | None | VerifyMode | bool`
+ src/pip/_vendor/urllib3/util/ssl_.py:182:62: error[invalid-argument-type] Argument to function `wrap_socket` is incorrect: Expected `StrOrBytesPath | None`, found `Unknown | None | VerifyMode | bool`
- Found 625 diagnostics
+ Found 630 diagnostics

black (https://github.com/psf/black)
- src/black/ranges.py:404:28: error[invalid-argument-type] Argument to function `first_leaf` is incorrect: Expected `Leaf | Node`, found `object`
+ src/black/ranges.py:404:28: error[invalid-argument-type] Argument to function `first_leaf` is incorrect: Expected `LN`, found `object`
- src/black/ranges.py:405:26: error[invalid-argument-type] Argument to function `last_leaf` is incorrect: Expected `Leaf | Node`, found `object`
+ src/black/ranges.py:405:26: error[invalid-argument-type] Argument to function `last_leaf` is incorrect: Expected `LN`, found `object`
- src/black/trans.py:470:20: error[invalid-return-type] Return type does not match returned value: expected `Ok[list[int]] | Err[CannotTransform]`, found `Ok[list[Unknown] & ~AlwaysFalsy]`
+ src/black/trans.py:470:20: error[invalid-return-type] Return type does not match returned value: expected `TMatchResult`, found `Ok[list[Unknown] & ~AlwaysFalsy]`
- src/black/trans.py:984:20: error[invalid-return-type] Return type does not match returned value: expected `Ok[list[int]] | Err[CannotTransform]`, found `Ok[list[Unknown] & ~AlwaysFalsy]`
+ src/black/trans.py:984:20: error[invalid-return-type] Return type does not match returned value: expected `TMatchResult`, found `Ok[list[Unknown] & ~AlwaysFalsy]`
- src/black/trans.py:1111:20: error[invalid-return-type] Return type does not match returned value: expected `Ok[list[int]] | Err[CannotTransform]`, found `(Ok[None] & Top[Err[Unknown]]) | Err[CannotTransform]`
+ src/black/trans.py:1111:20: error[invalid-return-type] Return type does not match returned value: expected `TMatchResult`, found `(Ok[None] & Top[Err[Unknown]]) | Err[CannotTransform]`
- src/blib2to3/pytree.py:149:13: error[unresolved-attribute] Unresolved attribute `parent` on type `object`
+ src/blib2to3/pytree.py:149:13: error[invalid-assignment] Object of type `Node` is not assignable to attribute `parent` on type `object | NL`

graphql-core (https://github.com/graphql-python/graphql-core)
- src/graphql/execution/execute.py:1654:42: error[invalid-await] `Awaitable[ReconcilableDeferredGroupedFieldSetResult | NonReconcilableDeferredGroupedFieldSetResult] | ReconcilableDeferredGroupedFieldSetResult | NonReconcilableDeferredGroupedFieldSetResult` is not awaitable
+ src/graphql/execution/execute.py:1654:42: error[invalid-await] `Awaitable[DeferredGroupedFieldSetResult] | DeferredGroupedFieldSetResult` is not awaitable
- src/graphql/execution/execute.py:1657:21: error[invalid-assignment] Object of type `BoxedAwaitableOrValue[CoroutineType[Any, Any, ReconcilableDeferredGroupedFieldSetResult | NonReconcilableDeferredGroupedFieldSetResult] | ReconcilableDeferredGroupedFieldSetResult | NonReconcilableDeferredGroupedFieldSetResult]` is not assignable to attribute `result` of type `BoxedAwaitableOrValue[ReconcilableDeferredGroupedFieldSetResult | NonReconcilableDeferredGroupedFieldSetResult] | (() -> BoxedAwaitableOrValue[ReconcilableDeferredGroupedFieldSetResult | NonReconcilableDeferredGroupedFieldSetResult])`
+ src/graphql/execution/execute.py:1657:21: error[invalid-assignment] Object of type `BoxedAwaitableOrValue[CoroutineType[Any, Any, DeferredGroupedFieldSetResult] | ReconcilableDeferredGroupedFieldSetResult | NonReconcilableDeferredGroupedFieldSetResult]` is not assignable to attribute `result` of type `BoxedAwaitableOrValue[DeferredGroupedFieldSetResult] | (() -> BoxedAwaitableOrValue[DeferredGroupedFieldSetResult])`
- src/graphql/execution/execute.py:1809:32: error[invalid-argument-type] Argument to bound method `append` is incorrect: Expected `BoxedAwaitableOrValue[StreamItemResult] | (() -> BoxedAwaitableOrValue[StreamItemResult])`, found `BoxedAwaitableOrValue[CoroutineType[Any, Any, StreamItemResult] | StreamItemResult]`
+ src/graphql/execution/execute.py:1809:32: error[invalid-argument-type] Argument to bound method `append` is incorrect: Expected `StreamItemRecord`, found `BoxedAwaitableOrValue[CoroutineType[Any, Any, StreamItemResult] | StreamItemResult]`
- src/graphql/execution/incremental_graph.py:349:27: error[invalid-argument-type] Argument to bound method `_enqueue` is incorrect: Expected `ReconcilableDeferredGroupedFieldSetResult | NonReconcilableDeferredGroupedFieldSetResult | StreamItemsResult`, found `object`
+ src/graphql/execution/incremental_graph.py:349:27: error[invalid-argument-type] Argument to bound method `_enqueue` is incorrect: Expected `IncrementalDataRecordResult`, found `object`
- src/graphql/utilities/build_client_schema.py:264:81: error[invalid-assignment] Object of type `dict[str, ((IntrospectionScalarType | IntrospectionObjectType | IntrospectionInterfaceType | ... omitted 3 union elements, /) -> GraphQLNamedType) | ((scalar_introspection: IntrospectionScalarType) -> GraphQLScalarType) | ((object_introspection: IntrospectionObjectType) -> GraphQLObjectType) | ... omitted 4 union elements]` is not assignable to `dict[str, (IntrospectionScalarType | IntrospectionObjectType | IntrospectionInterfaceType | ... omitted 3 union elements, /) -> GraphQLNamedType]`
+ src/graphql/utilities/build_client_schema.py:264:81: error[invalid-assignment] Object of type `dict[str, ((IntrospectionType, /) -> GraphQLNamedType) | ((scalar_introspection: IntrospectionScalarType) -> GraphQLScalarType) | ((object_introspection: IntrospectionObjectType) -> GraphQLObjectType) | ... omitted 4 union elements]` is not assignable to `dict[str, (IntrospectionType, /) -> GraphQLNamedType]`
- src/graphql/utilities/lexicographic_sort_schema.py:55:35: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Argument type `GraphQLList[Unknown] | GraphQLNonNull[Unknown] | GraphQLNamedType` does not satisfy upper bound `GraphQLScalarType | GraphQLObjectType | GraphQLInterfaceType | ... omitted 4 union elements` of type variable `GNT_co`
+ src/graphql/utilities/lexicographic_sort_schema.py:55:35: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Argument type `GraphQLList[Unknown] | GraphQLNonNull[Unknown] | GraphQLNamedType` does not satisfy upper bound `GraphQLNullableType` of type variable `GNT_co`
+ src/graphql/utilities/type_info.py:194:21: error[no-matching-overload] No overload of function `get_nullable_type` matches arguments
+ src/graphql/validation/rules/values_of_correct_type.py:70:17: error[no-matching-overload] No overload of function `get_nullable_type` matches arguments
- tests/type/test_validation.py:74:24: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Argument type `GraphQLNamedType` does not satisfy upper bound `GraphQLScalarType | GraphQLObjectType | GraphQLInterfaceType | ... omitted 4 union elements` of type variable `GNT_co`
+ tests/type/test_validation.py:74:24: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Argument type `GraphQLNamedType` does not satisfy upper bound `GraphQLNullableType` of type variable `GNT_co`
- Found 638 diagnostics
+ Found 640 diagnostics

aiortc (https://github.com/aiortc/aiortc)
- src/aiortc/rtcpeerconnection.py:132:24: error[invalid-argument-type] Argument to function `__new__` is incorrect: Expected `str | Buffer | SupportsInt | SupportsIndex | SupportsTrunc`, found `int | str | None`
+ src/aiortc/rtcpeerconnection.py:132:24: error[invalid-argument-type] Argument to function `__new__` is incorrect: Expected `ConvertibleToInt`, found `int | str | None`
- src/aior

... (truncated 5933 lines) ...
Memory usage changes were detected when running on open source projects
trio (https://github.com/python-trio/trio)
-     struct metadata = ~10MB
+     struct metadata = ~11MB
-     memo metadata = ~31MB
+     memo metadata = ~33MB

sphinx (https://github.com/sphinx-doc/sphinx)
- TOTAL MEMORY USAGE: ~287MB
+ TOTAL MEMORY USAGE: ~301MB

@astral-sh-bot

astral-sh-bot Bot commented Dec 29, 2025

Copy link
Copy Markdown

ecosystem-analyzer results

Lint rule Added Removed Changed
invalid-argument-type 218 47 2,749
invalid-key 4 4 1,834
invalid-assignment 12 5 210
unresolved-attribute 25 1 141
no-matching-overload 113 0 0
invalid-return-type 20 2 90
type-assertion-failure 24 0 77
not-subscriptable 3 0 52
unsupported-operator 4 0 41
invalid-context-manager 0 0 42
not-iterable 2 3 19
unused-type-ignore-comment 6 8 0
invalid-type-form 0 0 9
invalid-yield 0 0 8
assert-type-unspellable-subtype 0 0 3
conflicting-declarations 0 0 3
redundant-cast 0 0 3
invalid-await 0 0 2
invalid-parameter-default 0 0 2
invalid-typed-dict-field 0 0 2
missing-typed-dict-key 0 2 0
invalid-declaration 0 0 1
possibly-missing-attribute 0 1 0
Total 431 73 5,288

Showing a random sample of 135 of 5792 changes. See the HTML report for the full diff.

Raw diff sample (135 of 5792 changes)
altair (https://github.com/vega/altair)
- tests/vegalite/v6/test_renderers.py:112:10 error[invalid-context-manager] Object of type `PluginEnabler[(...) -> dict[str, Any] | tuple[dict[str, Any], dict[str, Any]], dict[str, Any] | tuple[dict[str, Any], dict[str, Any]]]` cannot be used with `with` because it does not correctly implement `__exit__`
+ tests/vegalite/v6/test_renderers.py:112:10 error[invalid-context-manager] Object of type `PluginEnabler[(...) -> MimeBundleType, MimeBundleType]` cannot be used with `with` because it does not correctly implement `__exit__`

apprise (https://github.com/caronc/apprise)
- apprise/plugins/mastodon.py:1118:21 error[invalid-argument-type] Argument to constructor `int.__new__` is incorrect: Expected `str | Buffer | SupportsInt | SupportsIndex | SupportsTrunc`, found `str | None`
+ apprise/plugins/mastodon.py:1118:21 error[invalid-argument-type] Argument to constructor `int.__new__` is incorrect: Expected `ConvertibleToInt`, found `str | None`

bokeh (https://github.com/bokeh/bokeh)
- src/bokeh/models/annotations/html/labels.py:85:34 error[invalid-argument-type] Argument to `Property.__init__` is incorrect: Expected `Property[Unknown] | tuple[Property[Unknown], Property[Unknown], Property[Unknown], Property[Unknown]] | Corners[Property[Unknown]] | UndefinedType | IntrinsicType`, found `Literal[0]`
+ src/bokeh/models/annotations/html/labels.py:85:34 error[invalid-argument-type] Argument to `Property.__init__` is incorrect: Expected `BorderRadiusType | UndefinedType | IntrinsicType`, found `Literal[0]`
- src/bokeh/plotting/_figure.py:222:13 error[invalid-argument-type] Argument to function `process_active_tools` is incorrect: Expected `list[InspectTool] | InspectTool | str | None`, found `Nullable[Any | str]`
+ src/bokeh/plotting/_figure.py:222:13 error[invalid-argument-type] Argument to function `process_active_tools` is incorrect: Expected `ActiveInspect`, found `Nullable[Any | str]`
- src/bokeh/plotting/_plot.py:98:32 error[invalid-argument-type] Argument to `Range1d.__init__` is incorrect: Expected `int | float | datetime | timedelta`, found `int | float | (Unknown & ~None) | str | IntrinsicType`
+ src/bokeh/plotting/_plot.py:98:32 error[invalid-argument-type] Argument to `Range1d.__init__` is incorrect: Expected `Value`, found `int | float | (Unknown & ~None) | str | IntrinsicType`
- src/bokeh/transform.py:159:13 error[invalid-argument-type] Argument to `EqHistColorMapper.__init__` is incorrect: Expected `str | tuple[int, int, int] | tuple[int, int, int, int | float] | None`, found `str | Color | tuple[int, int, int] | tuple[int, int, int, int | float] | None`
+ src/bokeh/transform.py:159:13 error[invalid-argument-type] Argument to `EqHistColorMapper.__init__` is incorrect: Expected `Color | None`, found `ColorLike | None`
- src/bokeh/transform.py:373:13 error[invalid-argument-type] Argument to `LinearColorMapper.__init__` is incorrect: Expected `str | tuple[int, int, int] | tuple[int, int, int, int | float] | None`, found `str | Color | tuple[int, int, int] | tuple[int, int, int, int | float] | None`
+ src/bokeh/transform.py:373:13 error[invalid-argument-type] Argument to `LinearColorMapper.__init__` is incorrect: Expected `Color | None`, found `ColorLike | None`

cloud-init (https://github.com/canonical/cloud-init)
- cloudinit/config/cc_ntp.py:360:23 error[invalid-argument-type] Argument to function `exists` is incorrect: Expected `int | str | bytes | PathLike[str] | PathLike[bytes]`, found `Unknown | None`
+ cloudinit/config/cc_ntp.py:360:23 error[invalid-argument-type] Argument to function `exists` is incorrect: Expected `FileDescriptorOrPath`, found `Unknown | None`

colour (https://github.com/colour-science/colour)
- colour/geometry/primitives.py:227:9 error[invalid-argument-type] Argument to function `zeros` is incorrect: Expected `type[signedinteger[_8Bit] | signedinteger[_16Bit] | signedinteger[_32Bit] | ... omitted 8 types] | None`, found `list[tuple[str, type[floating[_16Bit] | floating[_32Bit] | float64], int]]`
- colour/plotting/models.py:319:9 error[invalid-argument-type] Argument to function `zeros` is incorrect: Expected `type[signedinteger[_8Bit] | signedinteger[_16Bit] | signedinteger[_32Bit] | ... omitted 8 types] | None`, found `list[tuple[str, type[floating[_16Bit] | floating[_32Bit] | float64], int]]`

cryptography (https://github.com/pyca/cryptography)
- tests/hazmat/primitives/test_hkdf.py:250:25 error[invalid-argument-type] Argument to bound method `HKDFExpand.derive` is incorrect: Expected `bytes | bytearray | memoryview[int]`, found `Literal["first"]`
+ tests/hazmat/primitives/test_hkdf.py:250:25 error[invalid-argument-type] Argument to bound method `HKDFExpand.derive` is incorrect: Expected `Buffer`, found `Literal["first"]`
- tests/hazmat/primitives/test_hmac.py:36:22 error[invalid-argument-type] Argument to bound method `HMAC.update` is incorrect: Expected `bytes | bytearray | memoryview[int]`, found `Literal["ü"]`
+ tests/hazmat/primitives/test_hmac.py:36:22 error[invalid-argument-type] Argument to bound method `HMAC.update` is incorrect: Expected `Buffer`, found `Literal["ü"]`
- tests/hazmat/primitives/test_padding.py:171:29 error[invalid-argument-type] Argument to bound method `PaddingContext.update` is incorrect: Expected `bytes | bytearray | memoryview[int]`, found `Literal["abc"]`
+ tests/hazmat/primitives/test_padding.py:171:29 error[invalid-argument-type] Argument to bound method `PaddingContext.update` is incorrect: Expected `Buffer`, found `Literal["abc"]`
- tests/x509/test_x509_ext.py:2297:28 error[invalid-argument-type] Argument to `IPAddress.__init__` is incorrect: Expected `IPv4Address | IPv6Address | IPv4Network | IPv6Network`, found `float`
+ tests/x509/test_x509_ext.py:2297:28 error[invalid-argument-type] Argument to `IPAddress.__init__` is incorrect: Expected `_IPAddressTypes`, found `float`

cwltool (https://github.com/common-workflow-language/cwltool)
- cwltool/checker.py:141:62 error[invalid-argument-type] Argument to function `can_assign_src_to_sink` is incorrect: Expected `int | str | float | ... omitted 6 union elements`, found `~Literal["null"]`
+ cwltool/checker.py:141:62 error[invalid-argument-type] Argument to function `can_assign_src_to_sink` is incorrect: Expected `SinkType | None`, found `~Literal["null"]`

dd-trace-py (https://github.com/DataDog/dd-trace-py)
- tests/ci_visibility/test_encoder.py:511:41 error[invalid-argument-type] Argument to constructor `int.__new__` is incorrect: Expected `str | Buffer | SupportsInt | SupportsIndex | SupportsTrunc`, found `str | None`
+ tests/ci_visibility/test_encoder.py:511:41 error[invalid-argument-type] Argument to constructor `int.__new__` is incorrect: Expected `ConvertibleToInt`, found `str | None`
- tests/ci_visibility/test_encoder.py:574:39 error[invalid-argument-type] Argument to constructor `int.__new__` is incorrect: Expected `str | Buffer | SupportsInt | SupportsIndex | SupportsTrunc`, found `str | None`
+ tests/ci_visibility/test_encoder.py:574:39 error[invalid-argument-type] Argument to constructor `int.__new__` is incorrect: Expected `ConvertibleToInt`, found `str | None`
- tests/profiling/collector/test_threading.py:1950:66 error[unresolved-attribute] Object of type `LockType | RLock | Semaphore | Condition` has no attribute `is_internal`
+ tests/profiling/collector/test_threading.py:1950:66 error[unresolved-attribute] Object of type `LockTypeInst` has no attribute `is_internal`
- tests/profiling/collector/test_threading.py:1956:17 error[unresolved-attribute] Object of type `LockType | RLock | Semaphore | Condition` has no attribute `_cond`
+ tests/profiling/collector/test_threading.py:1956:17 error[unresolved-attribute] Object of type `LockTypeInst` has no attribute `_cond`

freqtrade (https://github.com/freqtrade/freqtrade)
- freqtrade/data/metrics.py:265:9 error[invalid-argument-type] Argument is incorrect: Expected `Timestamp`, found `str | bytes | date | ... omitted 9 union elements`
+ freqtrade/data/metrics.py:265:9 error[invalid-argument-type] Argument is incorrect: Expected `Timestamp`, found `Scalar`
- freqtrade/plot/plotting.py:188:17 error[invalid-argument-type] Method `__getitem__` of type `Overload[[ScalarT](idx: tuple[int | str | Timestamp | tuple[str | bytes | date | ... omitted 9 union elements, ...] | ((DataFrame, /) -> ScalarT), int | str | tuple[str | bytes | date | ... omitted 9 union elements, ...]]) -> str | bytes | date | ... omitted 9 union elements, [ScalarT, HashableT](idx: ((DataFrame, /) -> ScalarT) | tuple[slice[Any, Any, Any] | ndarray[tuple[Any, ...], dtype[integer[Any]]] | Index[Any] | ... omitted 8 union elements, ScalarT | None] | None) -> Series[Any], (idx: str | bytes | date | ... omitted 9 union elements) -> Series[Any] | DataFrame, (idx: tuple[str | bytes | date | ... omitted 9 union elements, slice[Any, Any, Any]] | tuple[slice[Any, Any, Any], tuple[str | bytes | date | ... omitted 9 union elements, ...]]) -> Series[Any] | DataFrame, [HashableT](key: slice[Any, Any, Any] | ndarray[tuple[Any, ...], dtype[integer[Any]]] | Index[Any] | ... omitted 8 union elements) -> DataFrame]` cannot be called with key of type `tuple[datetime, Literal["cum_profit"]]` on object of type `_LocIndexerFrame[DataFrame]`
+ freqtrade/plot/plotting.py:188:17 error[invalid-argument-type] Method `__getitem__` of type `Overload[[ScalarT](idx: tuple[int | StrLike | Timestamp | tuple[Scalar, ...] | ((DataFrame, /) -> ScalarT), int | StrLike | tuple[Scalar, ...]]) -> Scalar, [ScalarT, HashableT](idx: ((DataFrame, /) -> ScalarT) | tuple[slice[Any, Any, Any] | ndarray[tuple[Any, ...], dtype[integer[Any]]] | Index[Any] | ... omitted 8 union elements, ScalarT | None] | None) -> Series[Any], (idx: Scalar) -> Series[Any] | DataFrame, (idx: tuple[Scalar, slice[Any, Any, Any]] | tuple[slice[Any, Any, Any], tuple[Scalar, ...]]) -> Series[Any] | DataFrame, [HashableT](key: slice[Any, Any, Any] | ndarray[tuple[Any, ...], dtype[integer[Any]]] | Index[Any] | ... omitted 8 union elements) -> DataFrame]` cannot be called with key of type `tuple[datetime, Literal["cum_profit"]]` on object of type `_LocIndexerFrame[DataFrame]`
- freqtrade/rpc/rpc.py:794:46 error[invalid-argument-type] Argument to function `read_sql` is incorrect: Expected `str | ConnectionEventsTarget | sqlite3.Connection`, found `Engine | sqlalchemy.engine.base.Connection | None`
+ freqtrade/rpc/rpc.py:794:46 error[invalid-argument-type] Argument to function `read_sql` is incorrect: Expected `_SQLConnection`, found `Engine | Connection | None`

hydpy (https://github.com/hydpy-dev/hydpy)
- hydpy/core/testtools.py:2796:39 error[invalid-argument-type] Argument to bound method `HydPy.update_devices` is incorrect: Expected `Element | Iterable[Element | str] | None`, found `tuple[Device, Device, Device, Device, Device, Device, Device]`
+ hydpy/core/testtools.py:2796:39 error[invalid-argument-type] Argument to bound method `HydPy.update_devices` is incorrect: Expected `ElementsConstrArg | None`, found `tuple[Device, Device, Device, Device, Device, Device, Device]`

hydra-zen (https://github.com/mit-ll-responsible-ai/hydra-zen)
- tests/annotations/declarations.py:366:59 error[invalid-key] Unknown key "a" for TypedDict `EmptyDict`
- tests/annotations/declarations.py:944:5 error[type-assertion-failure] Type `PBuilds[Unknown]` does not match asserted type `PBuilds[int | None | float | ... omitted 15 union elements]`
+ tests/annotations/declarations.py:944:5 error[type-assertion-failure] Type `PBuilds[Unknown]` does not match asserted type `PBuilds[SupportedPrimitive]`

jax (https://github.com/google/jax)
- jax/_src/core.py:3288:26 error[invalid-argument-type] Argument to bound method `HiType.dec_rank` is incorrect: Expected `int | None`, found `int | Tracer[Unknown] | Var`
+ jax/_src/core.py:3288:26 error[invalid-argument-type] Argument to bound method `HiType.dec_rank` is incorrect: Expected `int | None`, found `AxisSize`
- jax/_src/nn/functions.py:1248:22 error[invalid-argument-type] Argument to function `reshape` is incorrect: Expected `Array | ndarray[tuple[Any, ...], dtype[Any]] | numpy.bool[builtins.bool] | ... omitted 4 union elements`, found `Unknown | tuple[Unknown, Array]`
+ jax/_src/nn/functions.py:1248:22 error[invalid-argument-type] Argument to function `reshape` is incorrect: Expected `ArrayLike`, found `Unknown | tuple[Unknown, Array]`

meson (https://github.com/mesonbuild/meson)
- mesonbuild/backend/ninjabackend.py:1775:41 error[invalid-argument-type] Argument to bound method `Compiler.get_colorout_args` is incorrect: Expected `str`, found `str | int | list[str]`
+ mesonbuild/backend/ninjabackend.py:1775:41 error[invalid-argument-type] Argument to bound method `Compiler.get_colorout_args` is incorrect: Expected `str`, found `ElementaryOptionValues`
- mesonbuild/build.py:881:19 error[invalid-argument-type] Argument to bound method `BuildTarget.link` is incorrect: Expected `list[BuildTarget | CustomTarget | CustomTargetIndex]`, found `list[SharedLibrary | StaticLibrary | CustomTarget | CustomTargetIndex]`
+ mesonbuild/build.py:881:19 error[invalid-argument-type] Argument to bound method `BuildTarget.link` is incorrect: Expected `list[BuildTargetTypes]`, found `list[LibTypes]`
- mesonbuild/build.py:1594:41 error[invalid-argument-type] Argument to bound method `BuildTarget.process_sourcelist` is incorrect: Expected `list[File | CustomTarget | CustomTargetIndex | ... omitted 4 union elements]`, found `list[File | CustomTarget | CustomTargetIndex | GeneratedList | StructuredSources]`
+ mesonbuild/build.py:1594:41 error[invalid-argument-type] Argument to bound method `BuildTarget.process_sourcelist` is incorrect: Expected `list[SourceOutputs]`, found `list[File | GeneratedTypes | StructuredSources]`
- mesonbuild/cmdline.py:47:16 error[invalid-return-type] Return type does not match returned value: expected `list[str]`, found `list[str | bytes] | list[bytes] | list[str]`
- mesonbuild/interpreter/interpreter.py:1727:63 error[invalid-argument-type] Argument to bound method `Interpreter.find_program_fallback` is incorrect: Expected `dict[OptionKey, str | int | list[str]]`, found `dict[OptionKey, str | int | list[str]] | None`
+ mesonbuild/interpreter/interpreter.py:1727:63 error[invalid-argument-type] Argument to bound method `Interpreter.find_program_fallback` is incorrect: Expected `dict[OptionKey, ElementaryOptionValues]`, found `dict[OptionKey, ElementaryOptionValues] | None`
- mesonbuild/interpreter/interpreter.py:2821:27 error[invalid-argument-type] Argument to function `open` is incorrect: Expected `int | str | bytes | PathLike[str] | PathLike[bytes]`, found `(str & ~AlwaysTruthy & ~AlwaysFalsy) | (Program & ~AlwaysTruthy & ~AlwaysFalsy) | (Unknown & ~AlwaysFalsy)`
+ mesonbuild/interpreter/interpreter.py:2821:27 error[invalid-argument-type] Argument to function `open` is incorrect: Expected `FileDescriptorOrPath`, found `(str & ~AlwaysTruthy & ~AlwaysFalsy) | (Program & ~AlwaysTruthy & ~AlwaysFalsy) | (Unknown & ~AlwaysFalsy)`
- mesonbuild/interpreter/interpreter.py:3101:52 error[invalid-argument-type] Argument to function `env_convertor_with_method` is incorrect: Expected `Literal["set", "prepend", "append"]`, found `Sequence[Divergent] | int | dict[str, Divergent] | ... omitted 5 union elements`
+ mesonbuild/interpreter/interpreter.py:3101:52 error[invalid-argument-type] Argument to function `env_convertor_with_method` is incorrect: Expected `Literal["set", "prepend", "append"]`, found `Sequence[TYPE_var] | int | dict[str, TYPE_elementary] | ... omitted 3 union elements`
+ unittests/cargotests.py:379:68 error[invalid-key] Unknown key "optional" for TypedDict `FromWorkspace`

mongo-python-driver (https://github.com/mongodb/mongo-python-driver)
- pymongo/message.py:1669:70 error[invalid-argument-type] Argument to bound method `ClientSession._apply_to` is incorrect: Expected `Connection`, found `AsyncConnection | Connection`
+ pymongo/message.py:1669:70 error[invalid-argument-type] Argument to bound method `ClientSession._apply_to` is incorrect: Expected `Connection`, found `_AgnosticConnection`

pandas (https://github.com/pandas-dev/pandas)
- pandas/core/dtypes/cast.py:340:42 error[invalid-argument-type] Argument to function `allclose` is incorrect: Expected `_Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | ... omitted 5 union elements`, found `ExtensionArray | ndarray[tuple[Any, ...], dtype[Any]]`
+ pandas/core/dtypes/cast.py:340:42 error[invalid-argument-type] Argument to function `allclose` is incorrect: Expected `numpy._typing._array_like.ArrayLike`, found `pandas._typing.ArrayLike`
- pandas/core/indexes/multi.py:2871:19 error[invalid-assignment] Object of type `ndarray[tuple[Any, ...], dtype[signedinteger[_64Bit]]]` is not assignable to `int`
+ pandas/core/indexes/multi.py:2871:19 error[invalid-assignment] Object of type `ndarray[tuple[Any, ...], dtype[signedinteger[_NBitIntP]]]` is not assignable to `int`
- pandas/tests/groupby/methods/test_quantile.py:102:51 error[invalid-argument-type] Argument to bound method `GroupBy.quantile` is incorrect: Expected `int | float | ExtensionArray | ... omitted 3 union elements`, found `list[int | float]`
+ pandas/tests/groupby/methods/test_quantile.py:102:51 error[invalid-argument-type] Argument to bound method `GroupBy.quantile` is incorrect: Expected `int | float | AnyArrayLike`, found `list[int | float]`
- pandas/tests/indexes/datetimes/methods/test_tz_localize.py:285:49 error[invalid-argument-type] Argument to constructor `DatetimeIndex.__new__` is incorrect: Expected `Literal["infer", "NaT", "raise"] | builtins.bool | ndarray[tuple[Any, ...], dtype[numpy.bool[builtins.bool]]]`, found `list[int]`
+ pandas/tests/indexes/datetimes/methods/test_tz_localize.py:285:49 error[invalid-argument-type] Argument to constructor `DatetimeIndex.__new__` is incorrect: Expected `TimeAmbiguous`, found `list[int]`
- pandas/tests/internals/test_internals.py:415:33 error[invalid-argument-type] Argument to bound method `NDFrame._from_mgr` is incorrect: Expected `BlockManager | SingleBlockManager`, found `DataFrame | Series`
+ pandas/tests/internals/test_internals.py:415:33 error[invalid-argument-type] Argument to bound method `NDFrame._from_mgr` is incorrect: Expected `Manager`, found `DataFrame | Series`
- pandas/tests/io/formats/style/test_style.py:987:30 error[invalid-argument-type] Argument to `DataFrame.__init__` is incorrect: Expected `ExtensionDtype | str | dtype[Any] | type | None`, found `list[str]`
+ pandas/tests/io/formats/style/test_style.py:987:30 error[invalid-argument-type] Argument to `DataFrame.__init__` is incorrect: Expected `Dtype | None`, found `list[str]`
- pandas/tests/io/formats/test_format.py:2334:23 error[invalid-argument-type] Argument to function `open` is incorrect: Expected `int | str | bytes | PathLike[str] | PathLike[bytes]`, found `StringIO | Unknown | str`
+ pandas/tests/io/formats/test_format.py:2334:23 error[invalid-argument-type] Argument to function `open` is incorrect: Expected `FileDescriptorOrPath`, found `StringIO | Unknown | str`
- pandas/tests/io/parser/dtypes/test_dtypes_basic.py:358:36 error[invalid-argument-type] Argument to constructor `floating.__new__` is incorrect: Expected `SupportsFloat | SupportsIndex | str | bytes | None`, found `list[int]`
+ pandas/tests/io/parser/dtypes/test_dtypes_basic.py:358:36 error[invalid-argument-type] Argument to constructor `floating.__new__` is incorrect: Expected `_ConvertibleToFloat | None`, found `list[int]`
- pandas/tests/io/parser/test_parse_dates.py:673:49 error[invalid-argument-type] Argument to constructor `DatetimeIndex.__new__` is incorrect: Expected `str | BaseOffset | _NoDefault`, found `None`
+ pandas/tests/io/parser/test_parse_dates.py:673:49 error[invalid-argument-type] Argument to constructor `DatetimeIndex.__new__` is incorrect: Expected `Frequency | _NoDefault`, found `None`
+ pandas/tests/io/test_sql.py:4063:52 error[invalid-argument-type] Argument to bound method `NDFrame.to_sql` is incorrect: Expected `DtypeArg | None`, found `dict[str, str]`
- pandas/tests/libs/test_libalgos.py:104:18 error[not-subscriptable] Cannot subscript object of type `def backfill(old: ndarray[tuple[Any, ...], dtype[Any]], new: ndarray[tuple[Any, ...], dtype[Any]], limit=...) -> ndarray[tuple[Any, ...], dtype[signedinteger[_64Bit]]]` with no `__getitem__` method
+ pandas/tests/libs/test_libalgos.py:104:18 error[not-subscriptable] Cannot subscript object of type `def backfill(old: ndarray[tuple[Any, ...], dtype[Any]], new: ndarray[tuple[Any, ...], dtype[Any]], limit=...) -> ndarray[tuple[Any, ...], dtype[signedinteger[_NBitIntP]]]` with no `__getitem__` method
- pandas/tests/series/methods/test_reindex.py:321:38 error[invalid-argument-type] Argument to bound method `Series.reindex` is incorrect: Expected `str | bytes | date | ... omitted 11 union elements`, found `Unknown | Timestamp | NaTType`
+ pandas/tests/series/methods/test_reindex.py:321:38 error[invalid-argument-type] Argument to bound method `Series.reindex` is incorrect: Expected `Scalar | None`, found `Unknown | Timestamp | NaTType`
- pandas/tests/test_algos.py:2016:32 error[invalid-argument-type] Argument to function `mode` is incorrect: Expected `ExtensionArray | ndarray[tuple[Any, ...], dtype[Any]]`, found `Index`
+ pandas/tests/test_algos.py:2016:32 error[invalid-argument-type] Argument to function `mode` is incorrect: Expected `ArrayLike`, found `Index`

pandas-stubs (https://github.com/pandas-dev/pandas-stubs)
- tests/extension/decimal/array.py:258:33 error[invalid-argument-type] Argument to constructor `Decimal.__new__` is incorrect: Expected `Decimal | int | float | str | tuple[int, Sequence[int], int]`, found `object`
+ tests/extension/decimal/array.py:258:33 error[invalid-argument-type] Argument to constructor `Decimal.__new__` is incorrect: Expected `_DecimalNew`, found `object | _DecimalNew`

pip (https://github.com/pypa/pip)
- src/pip/_vendor/urllib3/_request_methods.py:269:31 error[invalid-argument-type] Argument to function `urlencode` is incorrect: Expected `Mapping[str, object] | Mapping[bytes, object] | Mapping[str | bytes, object] | Sequence[tuple[str | bytes, object]]`, found `(Sequence[tuple[str, str | bytes | tuple[str, str | bytes] | tuple[str, str | bytes, str]] | RequestField] & ~AlwaysFalsy) | (Mapping[str, str | bytes | tuple[str, str | bytes] | tuple[str, str | bytes, str]] & ~AlwaysFalsy)`
+ src/pip/_vendor/urllib3/_request_methods.py:269:31 error[invalid-argument-type] Argument to function `urlencode` is incorrect: Expected `_QueryType`, found `(Sequence[tuple[str, _TYPE_FIELD_VALUE_TUPLE] | RequestField] & ~AlwaysFalsy) | (Mapping[str, _TYPE_FIELD_VALUE_TUPLE] & ~AlwaysFalsy)`

pwndbg (https://github.com/pwndbg/pwndbg)
- pwndbg/aglib/elf.py:412:32 error[invalid-argument-type] Argument to function `map_inner` is incorrect: Expected `Elf32_Ehdr | Elf64_Ehdr`, found `Elf32_Ehdr | Elf64_Ehdr | None`
+ pwndbg/aglib/elf.py:412:32 error[invalid-argument-type] Argument to function `map_inner` is incorrect: Expected `Ehdr`, found `Elf32_Ehdr | Elf64_Ehdr | None`
- pwndbg/aglib/heap/structs.py:186:60 error[invalid-argument-type] Method `__getitem__` of type `bound method dict[type[c_char], Type].__getitem__(key: type[c_char], /) -> Type` cannot be called with key of type `type[_Pointer[Any]]` on object of type `dict[type[c_char], Type]`
- pwndbg/commands/flags.py:59:31 error[invalid-argument-type] Argument to constructor `int.__new__` is incorrect: Expected `str | Buffer | SupportsInt | SupportsIndex | SupportsTrunc`, found `int | None`
+ pwndbg/commands/flags.py:59:31 error[invalid-argument-type] Argument to constructor `int.__new__` is incorrect: Expected `ConvertibleToInt`, found `int | None`

pydantic (https://github.com/pydantic/pydantic)
- pydantic/_internal/_generate_schema.py:2862:23 error[invalid-argument-type] Argument is incorrect: Expected `<TypedDict with items 'function', 'json_schema_input_schema', 'metadata', 'ref', 'schema', 'serialization', 'type'> | Iterable[tuple[str, object]]`, found `InvalidSchema | AnySchema | NoneSchema | ... omitted 49 union elements`
+ pydantic/_internal/_generate_schema.py:2862:23 error[invalid-argument-type] Argument is incorrect: Expected `<TypedDict with items 'function', 'json_schema_input_schema', 'metadata', 'ref', 'schema', 'serialization', 'type'> | Iterable[tuple[str, object]]`, found `CoreSchema`
- pydantic/_internal/_generate_schema.py:2862:23 error[invalid-argument-type] Argument is incorrect: Expected `<TypedDict with items 'ge', 'gt', 'le', 'lt', 'metadata', 'multiple_of', 'ref', 'serialization', 'strict', 'type'> | Iterable[tuple[str, object]]`, found `InvalidSchema | AnySchema | NoneSchema | ... omitted 49 union elements`
+ pydantic/_internal/_generate_schema.py:2862:23 error[invalid-argument-type] Argument is incorrect: Expected `<TypedDict with items 'ge', 'gt', 'le', 'lt', 'metadata', 'multiple_of', 'ref', 'serialization', 'strict', 'type'> | Iterable[tuple[str, object]]`, found `CoreSchema`
- pydantic/_internal/_mock_val_ser.py:173:5 error[invalid-assignment] Object of type `MockCoreSchema` is not assignable to attribute `__pydantic_core_schema__` of type `InvalidSchema | AnySchema | NoneSchema | ... omitted 49 union elements`
+ pydantic/_internal/_mock_val_ser.py:173:5 error[invalid-assignment] Object of type `MockCoreSchema` is not assignable to attribute `__pydantic_core_schema__` of type `CoreSchema`
- pydantic/_internal/_schema_gather.py:107:34 error[invalid-key] Unknown key "definitions" for TypedDict `BytesSchema` (subscripted object has type `InvalidSchema | AnySchema | NoneSchema | ... omitted 56 union elements`)
+ pydantic/_internal/_schema_gather.py:107:34 error[invalid-key] Unknown key "definitions" for TypedDict `BytesSchema` (subscripted object has type `CoreSchema | SerSchema | ComputedField`)
- pydantic/_internal/_schema_gather.py:111:36 error[invalid-key] Unknown key "items_schema" for TypedDict `AfterValidatorFunctionSchema` (subscripted object has type `InvalidSchema | AnySchema | NoneSchema | ... omitted 56 union elements`)
+ pydantic/_internal/_schema_gather.py:111:36 error[invalid-key] Unknown key "items_schema" for TypedDict `AfterValidatorFunctionSchema` (subscripted object has type `CoreSchema | SerSchema | ComputedField`)
- pydantic/_internal/_schema_gather.py:114:29 error[invalid-key] Unknown key "items_schema" for TypedDict `CallableSchema` (subscripted object has type `InvalidSchema | AnySchema | NoneSchema | ... omitted 56 union elements`)
+ pydantic/_internal/_schema_gather.py:114:29 error[invalid-key] Unknown key "items_schema" for TypedDict `CallableSchema` (subscripted object has type `CoreSchema | SerSchema | ComputedField`)
- pydantic/_internal/_schema_gather.py:114:29 error[invalid-key] Unknown key "items_schema" for TypedDict `ChainSchema` (subscripted object has type `InvalidSchema | AnySchema | NoneSchema | ... omitted 56 union elements`)
+ pydantic/_internal/_schema_gather.py:114:29 error[invalid-key] Unknown key "items_schema" for TypedDict `ChainSchema` (subscripted object has type `CoreSchema | SerSchema | ComputedField`)
- pydantic/_internal/_schema_gather.py:120:36 error[invalid-key] Unknown key "values_schema" for TypedDict `JsonOrPythonSchema` (subscripted object has type `InvalidSchema | AnySchema | NoneSchema | ... omitted 56 union elements`)
+ pydantic/_internal/_schema_gather.py:120:36 error[invalid-key] Unknown key "values_schema" for TypedDict `JsonOrPythonSchema` (subscripted object has type `CoreSchema | SerSchema | ComputedField`)
- pydantic/_internal/_schema_gather.py:120:36 error[invalid-key] Unknown key "values_schema" for TypedDict `TimeSchema` (subscripted object has type `InvalidSchema | AnySchema | NoneSchema | ... omitted 56 union elements`)
+ pydantic/_internal/_schema_gather.py:120:36 error[invalid-key] Unknown key "values_schema" for TypedDict `TimeSchema` (subscripted object has type `CoreSchema | SerSchema | ComputedField`)
- pydantic/_internal/_schema_gather.py:125:25 error[invalid-key] Unknown key "choices" for TypedDict `BytesSchema` (subscripted object has type `InvalidSchema | AnySchema | NoneSchema | ... omitted 56 union elements`)
+ pydantic/_internal/_schema_gather.py:125:25 error[invalid-key] Unknown key "choices" for TypedDict `BytesSchema` (subscripted object has type `CoreSchema | SerSchema | ComputedField`)
- pydantic/_internal/_schema_gather.py:125:25 error[invalid-key] Unknown key "choices" for TypedDict `UrlSchema` (subscripted object has type `InvalidSchema | AnySchema | NoneSchema | ... omitted 56 union elements`)
+ pydantic/_internal/_schema_gather.py:125:25 error[invalid-key] Unknown key "choices" for TypedDict `UrlSchema` (subscripted object has type `CoreSchema | SerSchema | ComputedField`)
- pydantic/_internal/_schema_gather.py:128:28 error[invalid-key] Unknown key "steps" for TypedDict `BytesSchema` (subscripted object has type `InvalidSchema | AnySchema | NoneSchema | ... omitted 56 union elements`)
+ pydantic/_internal/_schema_gather.py:128:28 error[invalid-key] Unknown key "steps" for TypedDict `BytesSchema` (subscripted object has type `CoreSchema | SerSchema | ComputedField`)
- pydantic/_internal/_schema_gather.py:131:32 error[invalid-key] Unknown key "lax_schema" for TypedDict `FrozenSetSchema` (subscripted object has type `InvalidSchema | AnySchema | NoneSchema | ... omitted 56 union elements`)
+ pydantic/_internal/_schema_gather.py:131:32 error[invalid-key] Unknown key "lax_schema" for TypedDict `FrozenSetSchema` (subscripted object has type `CoreSchema | SerSchema | ComputedField`)
- pydantic/_internal/_schema_gather.py:131:32 error[invalid-key] Unknown key "lax_schema" for TypedDict `StringSchema` (subscripted object has type `InvalidSchema | AnySchema | NoneSchema | ... omitted 56 union elements`)
+ pydantic/_internal/_schema_gather.py:131:32 error[invalid-key] Unknown key "lax_schema" for TypedDict `StringSchema` (subscripted object has type `CoreSchema | SerSchema | ComputedField`)
- pydantic/_internal/_schema_gather.py:134:32 error[invalid-key] Unknown key "json_schema" for TypedDict `TupleSchema` (subscripted object has type `InvalidSchema | AnySchema | NoneSchema | ... omitted 56 union elements`)
+ pydantic/_internal/_schema_gather.py:134:32 error[invalid-key] Unknown key "json_schema" for TypedDict `TupleSchema` (subscripted object has type `CoreSchema | SerSchema | ComputedField`)
- pydantic/_internal/_schema_gather.py:135:32 error[invalid-key] Unknown key "python_schema" for TypedDict `ModelSchema` (subscripted object has type `InvalidSchema | AnySchema | NoneSchema | ... omitted 56 union elements`)
+ pydantic/_internal/_schema_gather.py:135:32 error[invalid-key] Unknown key "python_schema" for TypedDict `ModelSchema` (subscripted object has type `CoreSchema | SerSchema | ComputedField`)
- pydantic/_internal/_schema_gather.py:135:32 error[invalid-key] Unknown key "python_schema" for TypedDict `TaggedUnionSchema` (subscripted object has type `InvalidSchema | AnySchema | NoneSchema | ... omitted 56 union elements`)
+ pydantic/_internal/_schema_gather.py:135:32 error[invalid-key] Unknown key "python_schema" for TypedDict `TaggedUnionSchema` (subscripted object has type `CoreSchema | SerSchema | ComputedField`)
- pydantic/_internal/_schema_gather.py:138:36 error[invalid-key] Unknown key "extras_schema" for TypedDict `ListSchema` (subscripted object has type `InvalidSchema | AnySchema | NoneSchema | ... omitted 56 union elements`)
+ pydantic/_internal/_schema_gather.py:138:36 error[invalid-key] Unknown key "extras_schema" for TypedDict `ListSchema` (subscripted object has type `CoreSchema | SerSchema | ComputedField`)
- pydantic/_internal/_schema_gather.py:138:36 error[invalid-key] Unknown key "extras_schema" for TypedDict `StringSchema` (subscripted object has type `InvalidSchema | AnySchema | NoneSchema | ... omitted 56 union elements`)
+ pydantic/_internal/_schema_gather.py:138:36 error[invalid-key] Unknown key "extras_schema" for TypedDict `StringSchema` (subscripted object has type `CoreSchema | SerSchema | ComputedField`)
- pydantic/_internal/_schema_gather.py:140:29 error[invalid-key] Unknown key "computed_fields" for TypedDict `ComputedField` (subscripted object has type `InvalidSchema | AnySchema | NoneSchema | ... omitted 56 union elements`)
+ pydantic/_internal/_schema_gather.py:140:29 error[invalid-key] Unknown key "computed_fields" for TypedDict `ComputedField` (subscripted object has type `CoreSchema | SerSchema | ComputedField`)
- pydantic/_internal/_schema_gather.py:140:29 error[invalid-key] Unknown key "computed_fields" for TypedDict `ListSchema` (subscripted object has type `InvalidSchema | AnySchema | NoneSchema | ... omitted 56 union elements`)
+ pydantic/_internal/_schema_gather.py:140:29 error[invalid-key] Unknown key "computed_fields" for TypedDict `ListSchema` (subscripted object has type `CoreSchema | SerSchema | ComputedField`)
- pydantic/_internal/_schema_gather.py:142:25 error[invalid-key] Unknown key "fields" for TypedDict `MissingSentinelSchema` (subscripted object has type `InvalidSchema | AnySchema | NoneSchema | ... omitted 56 union elements`)
+ pydantic/_internal/_schema_gather.py:142:25 error[invalid-key] Unknown key "fields" for TypedDict `MissingSentinelSchema` (subscripted object has type `CoreSchema | SerSchema | ComputedField`)
- pydantic/_internal/_schema_gather.py:148:25 error[invalid-key] Unknown key "fields" for TypedDict `ComplexSchema` (subscripted object has type `InvalidSchema | AnySchema | NoneSchema | ... omitted 56 union elements`)
+ pydantic/_internal/_schema_gather.py:148:25 error[invalid-key] Unknown key "fields" for TypedDict `ComplexSchema` (subscripted object has type `CoreSchema | SerSchema | ComputedField`)
- pydantic/_internal/_schema_gather.py:148:25 error[invalid-key] Unknown key "fields" for TypedDict `JsonSchema` (subscripted object has type `InvalidSchema | AnySchema | NoneSchema | ... omitted 56 union elements`)
+ pydantic/_internal/_schema_gather.py:148:25 error[invalid-key] Unknown key "fields" for TypedDict `JsonSchema` (subscripted object has type `CoreSchema | SerSchema | ComputedField`)
- pydantic/_internal/_schema_gather.py:148:25 error[invalid-key] Unknown key "fields" for TypedDict `LaxOrStrictSchema` (subscripted object has type `InvalidSchema | AnySchema | NoneSchema | ... omitted 56 union elements`)
+ pydantic/_internal/_schema_gather.py:148:25 error[invalid-key] Unknown key "fields" for TypedDict `LaxOrStrictSchema` (subscripted object has type `CoreSchema | SerSchema | ComputedField`)
- pydantic/_internal/_schema_gather.py:148:25 error[invalid-key] Unknown key "fields" for TypedDict `TimeSchema` (subscripted object has type `InvalidSchema | AnySchema | NoneSchema | ... omitted 56 union elements`)
+ pydantic/_internal/_schema_gather.py:148:25 error[invalid-key] Unknown key "fields" for TypedDict `TimeSchema` (subscripted object has type `CoreSchema | SerSchema | ComputedField`)
- pydantic/_internal/_schema_gather.py:151:25 error[invalid-key] Unknown key "arguments_schema" for TypedDict `IntSchema` (subscripted object has type `InvalidSchema | AnySchema | NoneSchema | ... omitted 56 union elements`)
+ pydantic/_internal/_schema_gather.py:151:25 error[invalid-key] Unknown key "arguments_schema" for TypedDict `IntSchema` (subscripted object has type `CoreSchema | SerSchema | ComputedField`)
- pydantic/_internal/_schema_gather.py:151:25 error[invalid-key] Unknown key "arguments_schema" for TypedDict `TimedeltaSchema` (subscripted object has type `InvalidSchema | AnySchema | NoneSchema | ... omitted 56 union elements`)
+ pydantic/_internal/_schema_gather.py:151:25 error[invalid-key] Unknown key "arguments_schema" for TypedDict `TimedeltaSchema` (subscripted object has type `CoreSchema | SerSchema | ComputedField`)
- pydantic/_internal/_schema_gather.py:154:36 error[invalid-key] Unknown key "var_args_schema" for TypedDict `BeforeValidatorFunctionSchema` (subscripted object has type `InvalidSchema | AnySchema | NoneSchema | ... omitted 56 union elements`)
+ pydantic/_internal/_schema_gather.py:154:36 error[invalid-key] Unknown key "var_args_schema" for TypedDict `BeforeValidatorFunctionSchema` (subscripted object has type `CoreSchema | SerSchema | ComputedField`)
- pydantic/_internal/_schema_gather.py:158:25 error[invalid-key] Unknown key "arguments_schema" for TypedDict `NoneSchema` (subscripted object has type `InvalidSchema | AnySchema | NoneSchema | ... omitted 56 union elements`)
+ pydantic/_internal/_schema_gather.py:158:25 error[invalid-key] Unknown key "arguments_schema" for TypedDict `NoneSchema` (subscripted object has type `CoreSchema | SerSchema | ComputedField`)
- pydantic/_internal/_schema_gather.py:165:32 error[invalid-key] Unknown key "return_schema" for TypedDict `DataclassSchema` (subscripted object has type `InvalidSchema | AnySchema | NoneSchema | ... omitted 56 union elements`)
+ pydantic/_internal/_schema_gather.py:165:32 error[invalid-key] Unknown key "return_schema" for TypedDict `DataclassSchema` (subscripted object has type `CoreSchema | SerSchema | ComputedField`)
- pydantic/_internal/_schema_gather.py:168:36 error[invalid-key] Unknown key "schema" for TypedDict `CallSchema` (subscripted object has type `InvalidSchema | AnySchema | NoneSchema | ... omitted 56 union elements`)
+ pydantic/_internal/_schema_gather.py:168:36 error[invalid-key] Unknown key "schema" for TypedDict `CallSchema` (subscripted object has type `CoreSchema | SerSchema | ComputedField`)
- pydantic/_internal/_schema_gather.py:168:36 error[invalid-key] Unknown key "schema" for TypedDict `PlainSerializerFunctionSerSchema` (subscripted object has type `InvalidSchema | AnySchema | NoneSchema | ... omitted 56 union elements`)
+ pydantic/_internal/_schema_gather.py:168:36 error[invalid-key] Unknown key "schema" for TypedDict `PlainSerializerFunctionSerSchema` (subscripted object has type `CoreSchema | SerSchema | ComputedField`)
- pydantic/_internal/_schema_gather.py:174:36 error[invalid-key] Unknown key "return_schema" for TypedDict `UnionSchema` (subscripted object has type `InvalidSchema | AnySchema | NoneSchema | ... omitted 56 union elements`)
+ pydantic/_internal/_schema_gather.py:174:36 error[invalid-key] Unknown key "return_schema" for TypedDict `UnionSchema` (subscripted object has type `CoreSchema | SerSchema | ComputedField`)
- pydantic/_internal/_schema_gather.py:176:36 error[invalid-key] Unknown key "json_schema_input_schema" for TypedDict `CustomErrorSchema` (subscripted object has type `InvalidSchema | AnySchema | NoneSchema | ... omitted 56 union elements`)
+ pydantic/_internal/_schema_gather.py:176:36 error[invalid-key] Unknown key "json_schema_input_schema" for TypedDict `CustomErrorSchema` (subscripted object has type `CoreSchema | SerSchema | ComputedField`)
- pydantic/_internal/_schema_gather.py:180:36 error[invalid-key] Unknown key "return_schema" for TypedDict `BoolSchema` (subscripted object has type `InvalidSchema | AnySchema | NoneSchema | ... omitted 56 union elements`)
+ pydantic/_internal/_schema_gather.py:180:36 error[invalid-key] Unknown key "return_schema" for TypedDict `BoolSchema` (subscripted object has type `CoreSchema | SerSchema | ComputedField`)
- pydantic/_internal/_schema_gather.py:180:36 error[invalid-key] Unknown key "return_schema" for TypedDict `MultiHostUrlSchema` (subscripted object has type `InvalidSchema | AnySchema | NoneSchema | ... omitted 56 union elements`)
+ pydantic/_internal/_schema_gather.py:180:36 error[invalid-key] Unknown key "return_schema" for TypedDict `MultiHostUrlSchema` (subscripted object has type `CoreSchema | SerSchema | ComputedField`)
- pydantic/_internal/_schema_gather.py:182:36 error[invalid-key] Unknown key "schema" for TypedDict `PlainSerializerFunctionSerSchema` (subscripted object has type `InvalidSchema | AnySchema | NoneSchema | ... omitted 56 union elements`)
+ pydantic/_internal/_schema_gather.py:182:36 error[invalid-key] Unknown key "schema" for TypedDict `PlainSerializerFunctionSerSchema` (subscripted object has type `CoreSchema | SerSchema | ComputedField`)
- pydantic/_internal/_schema_gather.py:184:36 error[invalid-key] Unknown key "json_schema_input_schema" for TypedDict `SimpleSerSchema` (subscripted object has type `InvalidSchema | AnySchema | NoneSchema | ... omitted 56 union elements`)
+ pydantic/_internal/_schema_gather.py:184:36 error[invalid-key] Unknown key "json_schema_input_schema" for TypedDict `SimpleSerSchema` (subscripted object has type `CoreSchema | SerSchema | ComputedField`)
- pydantic/_internal/_schema_gather.py:184:36 error[invalid-key] Unknown key "json_schema_input_schema" for TypedDict `TypedDictSchema` (subscripted object has type `InvalidSchema | AnySchema | NoneSchema | ... omitted 56 union elements`)
+ pydantic/_internal/_schema_gather.py:184:36 error[invalid-key] Unknown key "json_schema_input_schema" for TypedDict `TypedDictSchema` (subscripted object has type `CoreSchema | SerSchema | ComputedField`)
- pydantic/_internal/_schema_gather.py:190:32 error[invalid-key] Unknown key "serialization" for TypedDict `SimpleSerSchema` (subscripted object has type `InvalidSchema | AnySchema | NoneSchema | ... omitted 56 union elements`)
+ pydantic/_internal/_schema_gather.py:190:32 error[invalid-key] Unknown key "serialization" for TypedDict `SimpleSerSchema` (subscripted object has type `CoreSchema | SerSchema | ComputedField`)
- pydantic/v1/env_settings.py:223:29 error[invalid-argument-type] Argument to constructor `Path.__new__` is incorrect: Expected `str | PathLike[str]`, found `str | PathLike[Unknown] | (list[str | PathLike[Unknown]] & PathLike[object]) | (tuple[str | PathLike[Unknown], ...] & PathLike[object])`
+ pydantic/v1/env_settings.py:223:29 error[invalid-argument-type] Argument to constructor `Path.__new__` is incorrect: Expected `_typeshed.StrPath`, found `pydantic.v1.typing.StrPath | str | PathLike[Unknown] | (list[pydantic.v1.typing.StrPath] & PathLike[object]) | (tuple[pydantic.v1.typing.StrPath, ...] & PathLike[object])`

scikit-learn (https://github.com/scikit-learn/scikit-learn)
- sklearn/model_selection/tests/test_validation.py:2094:5 error[invalid-assignment] Invalid subscript assignment with key of type `Literal["error_score"]` and value of type `Literal["raise"]` on object of type `dict[str, FailingClassifier | ndarray[tuple[int], dtype[signedinteger[_64Bit]]] | None | dict[Unknown, Unknown] | int]`
+ sklearn/model_selection/tests/test_validation.py:2094:5 error[invalid-assignment] Invalid subscript assignment with key of type `Literal["error_score"]` and value of type `Literal["raise"]` on object of type `dict[str, FailingClassifier | ndarray[tuple[int], dtype[signedinteger[_NBitIntP]]] | None | dict[Unknown, Unknown] | int]`

scipy (https://github.com/scipy/scipy)
- scipy/optimize/tests/test_differentiable_functions.py:691:49 error[invalid-argument-type] Argument to function `assert_array_almost_equal` is incorrect: Expected `_SupportsArray[dtype[numpy.bool[builtins.bool] | number[Any, int | float | complex]]] | _NestedSequence[_SupportsArray[dtype[numpy.bool[builtins.bool] | number[Any, int | float | complex]]]] | int | ... omitted 5 union elements`, found `Unknown | csr_array`
+ scipy/optimize/tests/test_differentiable_functions.py:691:49 error[invalid-argument-type] Argument to function `assert_array_almost_equal` is incorrect: Expected `_NumericArrayLike`, found `Unknown | csr_array`

scipy-stubs (https://github.com/scipy/scipy-stubs)
- tests/signal/test_filter_design.pyi:282:1 error[type-assertion-failure] Type `tuple[int, float64]` does not match asserted type `tuple[int, floating[_128Bit]]`
+ tests/signal/test_filter_design.pyi:282:1 error[type-assertion-failure] Type `tuple[int, float64]` does not match asserted type `tuple[int, floating[_NBitLongDouble]]`

scrapy (https://github.com/scrapy/scrapy)
- tests/test_downloadermiddleware_cookies.py:363:46 error[invalid-argument-type] Argument to `Request.__init__` is incorrect: Expected `dict[str, str] | list[VerboseCookie] | None`, found `dict[str, str | bytes]`
+ tests/test_downloadermiddleware_cookies.py:363:46 error[invalid-argument-type] Argument to `Request.__init__` is incorrect: Expected `CookiesT | None`, found `dict[str, bytes]`
- tests/test_http_request_form.py:44:75 error[invalid-argument-type] Argument to `FormRequest.__init__` is incorrect: Expected `dict[str, Iterable[str]] | list[tuple[str, Iterable[str]]] | None`, found `tuple[tuple[Literal["a"], Literal["one"]], tuple[Literal["a"], Literal["two"]], tuple[Literal["b"], Literal["2"]]]`
+ tests/test_http_request_form.py:44:75 error[invalid-argument-type] Argument to `FormRequest.__init__` is incorrect: Expected `FormdataType`, found `tuple[tuple[Literal["a"], Literal["one"]], tuple[Literal["a"], Literal["two"]], tuple[Literal["b"], Literal["2"]]]`

spack (https://github.com/spack/spack)
- lib/spack/spack/llnl/util/filesystem.py:168:5 error[invalid-assignment] Object of type `def copystat(src, dst, follow_symlinks=True) -> Unknown` is not assignable to attribute `copystat` of type `def copystat(src: str | bytes | PathLike[str] | PathLike[bytes], dst: str | bytes | PathLike[str] | PathLike[bytes], *, follow_symlinks: bool = True) -> None`
+ lib/spack/spack/llnl/util/filesystem.py:168:5 error[invalid-assignment] Object of type `def copystat(src, dst, follow_symlinks=True) -> Unknown` is not assignable to attribute `copystat` of type `def copystat(src: StrOrBytesPath, dst: StrOrBytesPath, *, follow_symlinks: bool = True) -> None`
- lib/spack/spack/test/directory_layout.py:135:70 error[invalid-argument-type] Argument to bound method `Spec.copy` is incorrect: Expected `int | str | list[str] | tuple[str, ...]`, found `SpecHashDescriptor`
+ lib/spack/spack/test/directory_layout.py:135:70 error[invalid-argument-type] Argument to bound method `Spec.copy` is incorrect: Expected `int | DepTypes`, found `SpecHashDescriptor`
- lib/spack/spack/test/stage.py:868:35 error[invalid-argument-type] Argument to function `exists` is incorrect: Expected `int | str | bytes | PathLike[str] | PathLike[bytes]`, found `Unknown | None`
+ lib/spack/spack/test/stage.py:868:35 error[invalid-argument-type] Argument to function `exists` is incorrect: Expected `FileDescriptorOrPath`, found `Unknown | None`

static-frame (https://github.com/static-frame/static-frame)
- static_frame/core/container_util.py:1773:20 error[invalid-argument-type] Method `__getitem__` of type `Overload[(index: int, /) -> Hashable, (index: slice[int | None, int | None, int | None], /) -> Sequence[Hashable]]` cannot be called with key of type `list[int]` on object of type `Sequence[Hashable]`
+ static_frame/core/container_util.py:1773:20 error[invalid-argument-type] Method `__getitem__` of type `Overload[(index: int, /) -> TLabel, (index: slice[int | None, int | None, int | None], /) -> Sequence[TLabel]]` cannot be called with key of type `list[int]` on object of type `Sequence[TLabel]`
- static_frame/core/index.py:484:62 error[unresolved-attribute] Attribute `step` is not defined on `Iterable[Hashable] & ~IndexBase & ~ContainerOperand & ~str`, `Iterator[Hashable] & ~str`, `ndarray[Any, Any] & ~str` in union `(Iterable[Hashable] & ~IndexBase & ~ContainerOperand & ~str) | (Unknown & ~str) | (Iterator[Hashable] & ~str) | (ndarray[Any, Any] & ~str)`
+ static_frame/core/index.py:484:62 error[unresolved-attribute] Attribute `step` is not defined on `Iterable[TLabel] & ~IndexBase & ~ContainerOperand & ~str`, `Iterator[TLabel] & ~str`, `ndarray[Any, Any] & ~str` in union `(Iterable[TLabel] & ~IndexBase & ~ContainerOperand & ~str) | (Unknown & ~str) | (Iterator[TLabel] & ~str) | (ndarray[Any, Any] & ~str)`
- static_frame/core/yarn.py:211:39 error[invalid-assignment] Object of type `list[partial[Unknown] | <class 'IndexAutoConstructorFactory'>]` is not assignable to `((...) -> IndexBase) | type[Index[Any] | IndexAutoConstructorFactory] | None | Iterable[((...) -> IndexBase) | type[Index[Any]] | None]`
+ static_frame/core/yarn.py:211:39 error[invalid-assignment] Object of type `list[partial[Unknown] | <class 'IndexAutoConstructorFactory'>]` is not assignable to `TIndexCtorSpecifiers`
- static_frame/test/unit/test_batch.py:171:40 error[invalid-argument-type] Argument to `Batch.__init__` is incorrect: Expected `Iterator[tuple[Hashable, Frame | Series[Any, Any]]]`, found `IterNodeDelegateReducible[@Todo]`
+ static_frame/test/unit/test_batch.py:171:40 error[invalid-argument-type] Argument to `Batch.__init__` is incorrect: Expected `Iterator[tuple[TLabel, TFrameOrSeries]]`, found `IterNodeDelegateReducible[@Todo]`
- static_frame/test/unit/test_frame.py:9550:13 error[invalid-argument-type] Argument to bound method `Frame.from_delimited` is incorrect: Expected `str | PathLike[Any] | Iterator[str]`, found `list[LiteralString]`
+ static_frame/test/unit/test_frame.py:9550:13 error[invalid-argument-type] Argument to bound method `Frame.from_delimited` is incorrect: Expected `TPathSpecifierOrTextIOOrIterator`, found `list[LiteralString]`
- static_frame/test/unit/test_frame.py:9741:13 error[invalid-argument-type] Argument to bound method `Frame.from_delimited` is incorrect: Expected `str | PathLike[Any] | Iterator[str]`, found `list[LiteralString]`
+ static_frame/test/unit/test_frame.py:9741:13 error[invalid-argument-type] Argument to bound method `Frame.from_delimited` is incorrect: Expected `TPathSpecifierOrTextIOOrIterator`, found `list[LiteralString]`
- static_frame/test/unit/test_frame.py:22218:30 error[invalid-argument-type] Argument to bound method `Frame.rank_ordinal` is incorrect: Expected `bool | Sequence[bool]`, found `GeneratorType[Unknown, None, None]`
+ static_frame/test/unit/test_frame.py:22218:30 error[invalid-argument-type] Argument to bound method `Frame.rank_ordinal` is incorrect: Expected `TBoolOrBools`, found `GeneratorType[Unknown, None, None]`
- static_frame/test/unit/test_store.py:180:17 error[invalid-argument-type] Argument is incorrect: Expected `((...) -> IndexBase) | type[Index[Any] | IndexAutoConstructorFactory] | None | Iterable[((...) -> IndexBase) | type[Index[Any]] | None]`, found `int`
+ static_frame/test/unit/test_store.py:180:17 error[invalid-argument-type] Argument is incorrect: Expected `((TLabel, @Todo, /) -> @Todo) | None`, found `int`
- static_frame/test/unit/test_type_clinic.py:1966:39 error[invalid-argument-type] Argument to `LabelsOrder.__init__` is incorrect: Expected `Sequence[Hashable]`, found `EllipsisType`
+ static_frame/test/unit/test_type_clinic.py:1966:39 error[invalid-argument-type] Argument to `LabelsOrder.__init__` is incorrect: Expected `Sequence[TLabel]`, found `EllipsisType`

sympy (https://github.com/sympy/sympy)
- sympy/functions/elementary/tests/test_piecewise.py:215:25 error[invalid-argument-type] Argument to function `integrate` is incorrect: Expected `Expr | tuple[Expr, Expr] | tuple[Expr, Expr, Expr]`, found `tuple[Any, Literal[-2], Literal[2]]`
+ sympy/functions/elementary/tests/test_piecewise.py:215:25 error[invalid-argument-type] Argument to function `integrate` is incorrect: Expected `SymbolLimits`, found `tuple[Any, Literal[-2], Literal[2]]`
- sympy/geometry/tests/test_polygon.py:549:61 error[invalid-argument-type] Argument to function `integrate` is incorrect: Expected `Expr | tuple[Expr, Expr] | tuple[Expr, Expr, Expr]`, found `tuple[Any, Literal[0], Literal[4]]`
+ sympy/geometry/tests/test_polygon.py:549:61 error[invalid-argument-type] Argument to function `integrate` is incorrect: Expected `SymbolLimits`, found `tuple[Any, Literal[0], Literal[4]]`
- sympy/integrals/integrals.py:1198:40 error[invalid-argument-type] Argument to function `integrate` is incorrect: Expected `Expr | tuple[Expr, Expr] | tuple[Expr, Expr, Expr]`, found `Tuple`
+ sympy/integrals/integrals.py:1198:40 error[invalid-argument-type] Argument to function `integrate` is incorrect: Expected `SymbolLimits`, found `Tuple`
- sympy/integrals/tests/test_failing_integrals.py:55:45 error[invalid-argument-type] Argument to function `integrate` is incorrect: Expected `Expr | tuple[Expr, Expr] | tuple[Expr, Expr, Expr]`, found `tuple[Symbol, Literal[0], Literal[1]]`
+ sympy/integrals/tests/test_failing_integrals.py:55:45 error[invalid-argument-type] Argument to function `integrate` is incorrect: Expected `SymbolLimits`, found `tuple[Symbol, Literal[0], Literal[1]]`
- sympy/integrals/tests/test_integrals.py:1475:30 error[invalid-argument-type] Argument to function `integrate` is incorrect: Expected `Expr | tuple[Expr, Expr] | tuple[Expr, Expr, Expr]`, found `tuple[Any, Literal[-1], Literal[1]]`
+ sympy/integrals/tests/test_integrals.py:1475:30 error[invalid-argument-type] Argument to function `integrate` is incorrect: Expected `SymbolLimits`, found `tuple[Any, Literal[-1], Literal[1]]`
- sympy/integrals/tests/test_integrals.py:1669:40 error[invalid-argument-type] Argument to function `integrate` is incorrect: Expected `Expr | tuple[Expr, Expr] | tuple[Expr, Expr, Expr]`, found `tuple[Symbol, Literal[0], Unknown]`
+ sympy/integrals/tests/test_integrals.py:1669:40 error[invalid-argument-type] Argument to function `integrate` is incorrect: Expected `SymbolLimits`, found `tuple[Symbol, Literal[0], Unknown]`
- sympy/integrals/tests/test_integrals.py:1811:42 error[invalid-argument-type] Argument to function `integrate` is incorrect: Expected `Expr | tuple[Expr, Expr] | tuple[Expr, Expr, Expr]`, found `tuple[Any, Literal[0], Infinity]`
+ sympy/integrals/tests/test_integrals.py:1811:42 error[invalid-argument-type] Argument to function `integrate` is incorrect: Expected `SymbolLimits`, found `tuple[Any, Literal[0], Infinity]`
- sympy/integrals/tests/test_integrals.py:2087:29 error[invalid-argument-type] Argument to function `integrate` is incorrect: Expected `Expr | tuple[Expr, Expr] | tuple[Expr, Expr, Expr]`, found `tuple[Any, int | float, Literal[1]]`
+ sympy/integrals/tests/test_integrals.py:2087:29 error[invalid-argument-type] Argument to function `integrate` is incorrect: Expected `SymbolLimits`, found `tuple[Any, int | float, Literal[1]]`
- sympy/integrals/tests/test_integrals.py:2203:39 error[invalid-argument-type] Argument to function `integrate` is incorrect: Expected `Expr | tuple[Expr, Expr] | tuple[Expr, Expr, Expr]`, found `tuple[Any, Literal[0], Any]`
+ sympy/integrals/tests/test_integrals.py:2203:39 error[invalid-argument-type] Argument to function `integrate` is incorrect: Expected `SymbolLimits`, found `tuple[Any, Literal[0], Any]`
- sympy/printing/mathml.py:888:26 error[invalid-argument-type] Argument to bound method `Element.appendChild` is incorrect: Argument type `str` does not satisfy upper bound `Element | ProcessingInstruction | Comment | Text | DocumentFragment` of type variable `_ElementChildrenPlusFragment`
+ sympy/printing/mathml.py:888:26 error[invalid-argument-type] Argument to bound method `Element.appendChild` is incorrect: Argument type `str` does not satisfy upper bound `_ElementChildren | DocumentFragment` of type variable `_ElementChildrenPlusFragment`
- sympy/printing/mathml.py:1387:31 error[invalid-argument-type] Argument to bound method `Element.appendChild` is incorrect: Argument type `str` does not satisfy upper bound `Element | ProcessingInstruction | Comment | Text | DocumentFragment` of type variable `_ElementChildrenPlusFragment`
+ sympy/printing/mathml.py:1387:31 error[invalid-argument-type] Argument to bound method `Element.appendChild` is incorrect: Argument type `str` does not satisfy upper bound `_ElementChildren | DocumentFragment` of type variable `_ElementChildrenPlusFragment`
- sympy/printing/mathml.py:2105:23 error[invalid-argument-type] Argument to bound method `Element.appendChild` is incorrect: Argument type `str` does not satisfy upper bound `Element | ProcessingInstruction | Comment | Text | DocumentFragment` of type variable `_ElementChildrenPlusFragment`
+ sympy/printing/mathml.py:2105:23 error[invalid-argument-type] Argument to bound method `Element.appendChild` is incorrect: Argument type `str` does not satisfy upper bound `_ElementChildren | DocumentFragment` of type variable `_ElementChildrenPlusFragment`
- sympy/utilities/tests/test_wester.py:2463:41 error[invalid-argument-type] Argument to function `integrate` is incorrect: Expected `Expr | tuple[Expr, Expr] | tuple[Expr, Expr, Expr]`, found `tuple[Any, Literal[0], Literal[1]]`
+ sympy/utilities/tests/test_wester.py:2463:41 error[invalid-argument-type] Argument to function `integrate` is incorrect: Expected `SymbolLimits`, found `tuple[Any, Literal[0], Literal[1]]`
- sympy/utilities/tests/test_wester.py:2470:41 error[invalid-argument-type] Argument to function `integrate` is incorrect: Expected `Expr | tuple[Expr, Expr] | tuple[Expr, Expr, Expr]`, found `tuple[Any, Literal[1], Literal[2]]`
+ sympy/utilities/tests/test_wester.py:2470:41 error[invalid-argument-type] Argument to function `integrate` is incorrect: Expected `SymbolLimits`, found `tuple[Any, Literal[1], Literal[2]]`

urllib3 (https://github.com/urllib3/urllib3)
- test/test_collections.py:311:22 error[invalid-argument-type] Argument to bound method `HTTPHeaderDict.extend` is incorrect: Expected `Mapping[str, str] | Iterable[tuple[str, str]] | HasGettableStringKeys`, found `int`
+ test/test_collections.py:311:22 error[invalid-argument-type] Argument to bound method `HTTPHeaderDict.extend` is incorrect: Expected `ValidHTTPHeaderSource`, found `int`
- test/test_collections.py:422:28 error[invalid-argument-type] Argument to `HTTPHeaderDict.__init__` is incorrect: Expected `Mapping[str, str] | Iterable[tuple[str, str]] | HasGettableStringKeys | None`, found `dict[int, int]`
+ test/test_collections.py:422:28 error[invalid-argument-type] Argument to `HTTPHeaderDict.__init__` is incorrect: Expected `ValidHTTPHeaderSource | None`, found `dict[int, int]`
- test/with_dummyserver/test_poolmanager.py:793:17 error[invalid-argument-type] Argument to function `request` is incorrect: Expected `bytes | IO[Any] | Iterable[bytes | str] | None`, found `BadBody`
+ test/with_dummyserver/test_poolmanager.py:793:17 error[invalid-argument-type] Argument to function `request` is incorrect: Expected `_TYPE_BODY | None`, found `BadBody`

xarray (https://github.com/pydata/xarray)
- asv_bench/benchmarks/dataset_io.py:411:56 error[invalid-argument-type] Argument to function `open_mfdataset` is incorrect: Expected `str | int | tuple[int, ...] | None | Mapping[Any, str | int | tuple[int, ...] | None]`, found `dict[str, int | float]`
+ asv_bench/benchmarks/dataset_io.py:411:56 error[invalid-argument-type] Argument to function `open_mfdataset` is incorrect: Expected `T_Chunks`, found `dict[str, int | float]`

yarl (https://github.com/aio-libs/yarl)
- tests/test_url_query.py:231:26 error[invalid-argument-type] Argument to bound method `URL.update_query` is incorrect: Expected `None | str | Mapping[str, Sequence[str | SupportsInt] | SupportsInt] | Sequence[tuple[str, Sequence[str | SupportsInt] | SupportsInt]]`, found `memoryview[int]`
+ tests/test_url_query.py:231:26 error[invalid-argument-type] Argument to bound method `URL.update_query` is incorrect: Expected `Query`, found `memoryview[int]`

zulip (https://github.com/zulip/zulip)
+ analytics/migrations/0001_initial.py:206:13 error[invalid-argument-type] Argument to `AlterUniqueTogether.__init__` is incorrect: Expected `_OptionTogetherT | None`, found `set[tuple[str, str, str, str]]`
+ zerver/migrations/0051_realmalias_add_allow_subdomains.py:18:13 error[invalid-argument-type] Argument to `AlterUniqueTogether.__init__` is incorrect: Expected `_OptionTogetherT | None`, found `set[tuple[str, str]]`
+ zerver/migrations/0113_default_stream_group.py:34:13 error[invalid-argument-type] Argument to `AlterUniqueTogether.__init__` is incorrect: Expected `_OptionTogetherT | None`, found `set[tuple[str, str]]`

Full report with detailed diff (timing results)

@codspeed-hq

codspeed-hq Bot commented Dec 29, 2025

Copy link
Copy Markdown

Merging this PR will degrade performance by 9.58%

⚠️ Different runtime environments detected

Some benchmarks with significant performance changes were compared across different runtime environments,
which may affect the accuracy of the results.

Open the report in CodSpeed to investigate

⚡ 7 improved benchmarks
❌ 1 regressed benchmark
✅ 109 untouched benchmarks
🆕 2 new benchmarks

⚠️ Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Mode Benchmark BASE HEAD Efficiency
🆕 Simulation ty_micro[recursive_union_type_alias_and_protocol] N/A 74.3 ms N/A
Simulation ty_micro[typevar_mapping_accumulation] 370.3 ms 316.9 ms +16.84%
Simulation ty_micro[large_union_narrowing] 531 ms 587.3 ms -9.58%
WallTime pandas 62.2 s 59.5 s +4.61%
WallTime altair 5.1 s 4.6 s +9.18%
🆕 Memory ty_micro[recursive_union_type_alias_and_protocol] N/A 16.4 MB N/A
WallTime multithreaded 1.3 s 1 s +19.93%
WallTime pydantic 7.8 s 6.9 s +13.14%
WallTime colour_science 42.8 s 36.1 s +18.85%
Simulation hydra-zen 1.2 s 1 s +13.1%

Comparing mtshiba:implicit-recursive-union (8127108) with main (ea4b406)

Open in CodSpeed

@mtshiba

mtshiba commented Dec 30, 2025

Copy link
Copy Markdown
Collaborator Author

The codspeed (walltime) results seem to have improved in some cases and worsened in others.
Since instrumented tests showed almost no regressions, it is likely that the changes are due to higher-level compounding effects. For example, whether type alias expansion is eager or lazy may improve the inspection speed of some code while slowing down the inspection speed of other code. Or paths that were previously disabled by Divergent may be executed.
I think it would be difficult to improve everything.

@mtshiba

mtshiba commented Dec 30, 2025

Copy link
Copy Markdown
Collaborator Author

mypy and pyright seem to expand type aliases as much as possible, regardless of whether they are implicit or PEP-695 style (in the case of recursive type aliases, mypy seems to omit the recursive part and display it such as int | list[...]).
pyrefly does not expand both aliases whenever possible.

@mtshiba
mtshiba marked this pull request as ready for review January 5, 2026 15:09

@carljm carljm left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Reviewed the test changes here and most of the code changes. Overall this looks really good! Need to look more closely at the union-type changes, and the ecosystem impact. This will likely uncover more cases where we aren't handling Type::TypeAlias correctly, since implicit type aliases are much more used than PEP 695 ones today.

Comment thread crates/ty_python_semantic/src/types/infer/builder.rs Outdated

@carljm carljm left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks again for working on this, and sorry about the delay to complete my review. Lots of good stuff here, but I think we can do better than all the repeat inference we do in this PR.

Looking at the ecosystem report, the new aioredis diagnostics are false positives and a regression. It looks like we aren't resolving up the new implicit type alias type there in the generics constraint solver, so the constraint solver can't match to the formal parameter and infer typevars. I'm guessing this is a simple change to fix? (It may even be a pre-existing bug that would also show up if the same code used PEP 695 type alias, not sure.)

Comment thread crates/ty_python_semantic/resources/mdtest/narrow/isinstance.md Outdated
Comment thread crates/ty_python_semantic/src/types.rs Outdated
Comment thread crates/ty_python_semantic/src/types.rs Outdated
Comment thread crates/ty_python_semantic/src/types.rs Outdated
Comment thread crates/ty_python_semantic/src/types.rs Outdated
// Convert eager union instances to lazy for assignments
// This enables lazy evaluation for recursive type aliases like `Foo = int | list["Foo"]`
let value_ty = if let Some(instance) = value_ty.as_union_type_instance()
&& let Some(eager) = instance.as_eager(self.db())

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

So at this point we have already created an eager UnionTypeInstance, which means we've already inferred all its elements as both value and type expressions. Then, if it's convertible to lazy, we throw all of that away and store just the definition.

I wonder a) why we need to be so eager about creating the union_type that we do it before we check if we can convert to lazy, and b) why we throw away the value types rather than storing them in the lazy variant too.

I realize that typing.Union would need to be handled differently since there we never infer elements as value expressions. But in that case it seems like we have more control (we already know it's a union before inferring any element types) -- I think we could have special handling in the assignment inference for a top-level typing.Union subscripting, where we create a lazy union instance and don't infer any of the elements at all until we need them (using the existing infer_deferred_types mechanism that is already used for elements of TypeVar etc.)

Comment thread crates/ty_python_semantic/src/types.rs Outdated
DefinitionKind::AnnotatedAssignment(assignment) => assignment.value(&module).unwrap(),
_ => unreachable!(),
};
let value_expression = Expression::new(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This means we re-infer the expression type again, potentially twice. Why do we need to do this, when we already inferred its value types in type inference? Why can't the lazy UnionTypeInstance variant, and the implicit TypeAliasType variant, both store the value types we originally inferred?

(I realize this means typing.Union would need a different path; discussed that in a different comment.)

Comment thread crates/ty_python_semantic/src/types.rs Outdated
@carljm carljm self-assigned this Feb 14, 2026
@mtshiba
mtshiba marked this pull request as draft March 11, 2026 07:10
@astral-sh-bot

astral-sh-bot Bot commented Mar 11, 2026

Copy link
Copy Markdown

Memory usage report

Summary

Project Old New Diff Outcome
flake8 47.73MB 47.70MB -0.07% (36.08kB) ⬇️
trio 116.92MB 116.82MB -0.09% (105.90kB) ⬇️
sphinx 259.64MB 259.24MB -0.15% (407.65kB) ⬇️
prefect 692.15MB 691.06MB -0.16% (1.09MB) ⬇️

Significant changes

Click to expand detailed breakdown

flake8

Name Old New Diff Outcome
Type<'db>::apply_specialization_ 208.90kB 189.34kB -9.36% (19.56kB) ⬇️
infer_expression_types_impl 1.02MB 1.04MB +1.47% (15.36kB) ⬇️
is_redundant_with_impl 82.62kB 73.59kB -10.92% (9.02kB) ⬇️
is_redundant_with_impl::interned_arguments 85.85kB 77.60kB -9.61% (8.25kB) ⬇️
IntersectionType 45.22kB 37.64kB -16.76% (7.58kB) ⬇️
BoundMethodType<'db>::into_callable_type_ 27.19kB 19.88kB -26.90% (7.31kB) ⬇️
infer_definition_types 1.84MB 1.84MB -0.16% (3.06kB) ⬇️
infer_implicit_assignment_value_type 0.00B 2.91kB +2.91kB (new) ⬇️
infer_expression_type_impl 118.44kB 121.32kB +2.43% (2.88kB) ⬇️
when_constraint_set_assignable_to_owned_impl 79.04kB 76.17kB -3.63% (2.87kB) ⬇️
UnionTypeInstance 4.65kB 7.17kB +54.29% (2.52kB) ⬇️
infer_scope_types_impl 974.49kB 972.70kB -0.18% (1.79kB) ⬇️
ImplicitTypeAliasType 0.00B 1.55kB +1.55kB (new) ⬇️
Expression 368.58kB 369.91kB +0.36% (1.34kB) ⬇️
infer_deferred_types 563.69kB 562.50kB -0.21% (1.20kB) ⬇️
... 28 more

trio

Name Old New Diff Outcome
Type<'db>::apply_specialization_ 708.10kB 616.76kB -12.90% (91.34kB) ⬇️
infer_expression_types_impl 6.96MB 6.98MB +0.31% (21.80kB) ⬇️
BoundMethodType<'db>::into_callable_type_ 74.62kB 63.13kB -15.41% (11.50kB) ⬇️
infer_deferred_types 2.34MB 2.33MB -0.37% (8.88kB) ⬇️
is_redundant_with_impl 247.96kB 239.65kB -3.35% (8.31kB) ⬇️
is_redundant_with_impl::interned_arguments 289.18kB 281.79kB -2.56% (7.39kB) ⬇️
IntersectionType 133.16kB 126.23kB -5.20% (6.92kB) ⬇️
when_constraint_set_assignable_to_owned_impl 200.46kB 194.62kB -2.91% (5.84kB) ⬇️
infer_implicit_assignment_value_type 0.00B 4.85kB +4.85kB (new) ⬇️
UnionTypeInstance 7.97kB 12.62kB +58.33% (4.65kB) ⬇️
infer_expression_type_impl 1.30MB 1.30MB +0.32% (4.25kB) ⬇️
Type<'db>::class_member_with_policy_ 2.04MB 2.04MB +0.19% (4.05kB) ⬇️
infer_scope_types_impl 4.71MB 4.71MB -0.06% (3.09kB) ⬇️
ImplicitTypeAliasType 0.00B 2.92kB +2.92kB (new) ⬇️
ClassType<'db>::into_callable_ 7.78kB 5.26kB -32.38% (2.52kB) ⬇️
... 41 more

sphinx

Name Old New Diff Outcome
Type<'db>::apply_specialization_ 1.63MB 1.40MB -13.81% (230.09kB) ⬇️
BoundMethodType<'db>::into_callable_type_ 277.68kB 233.06kB -16.07% (44.61kB) ⬇️
infer_definition_types 23.58MB 23.55MB -0.14% (33.09kB) ⬇️
infer_deferred_types 5.27MB 5.24MB -0.51% (27.52kB) ⬇️
when_constraint_set_assignable_to_owned_impl 940.92kB 917.66kB -2.47% (23.27kB) ⬇️
infer_scope_types_impl 15.40MB 15.38MB -0.11% (17.25kB) ⬇️
is_redundant_with_impl 926.60kB 910.93kB -1.69% (15.66kB) ⬇️
is_redundant_with_impl::interned_arguments 1.07MB 1.06MB -1.07% (11.69kB) ⬇️
IntersectionType 462.69kB 454.26kB -1.82% (8.43kB) ⬇️
StaticClassLiteral<'db>::try_mro_ 1.90MB 1.89MB -0.37% (7.12kB) ⬇️
code_generator_of_static_class 742.89kB 749.50kB +0.89% (6.61kB) ⬇️
Type<'db>::member_lookup_with_policy_ 6.84MB 6.85MB +0.09% (6.60kB) ⬇️
UnionTypeInstance 15.54kB 21.65kB +39.32% (6.11kB) ⬇️
infer_implicit_assignment_value_type 0.00B 5.82kB +5.82kB (new) ⬇️
enum_metadata 704.48kB 700.04kB -0.63% (4.44kB) ⬇️
... 68 more

prefect

Name Old New Diff Outcome
Type<'db>::apply_specialization_ 3.67MB 3.07MB -16.39% (615.80kB) ⬇️
infer_definition_types 87.45MB 87.23MB -0.26% (229.50kB) ⬇️
infer_scope_types_impl 55.28MB 55.17MB -0.19% (106.51kB) ⬇️
BoundMethodType<'db>::into_callable_type_ 324.11kB 256.38kB -20.90% (67.72kB) ⬇️
when_constraint_set_assignable_to_owned_impl 1.53MB 1.48MB -3.42% (53.60kB) ⬇️
infer_deferred_types 11.01MB 10.98MB -0.31% (34.50kB) ⬇️
infer_expression_types_impl 60.04MB 60.07MB +0.05% (27.96kB) ⬇️
function_known_decorators 4.50MB 4.47MB -0.53% (24.36kB) ⬇️
Type<'db>::try_call_dunder_get_ 10.65MB 10.63MB -0.16% (17.36kB) ⬇️
StaticClassLiteral<'db>::implicit_attribute_inner_ 8.90MB 8.89MB -0.14% (12.38kB) ⬇️
infer_implicit_assignment_value_type 0.00B 12.20kB +12.20kB (new) ⬇️
is_redundant_with_impl 1.93MB 1.92MB -0.61% (11.99kB) ⬇️
UnionTypeInstance 29.09kB 39.84kB +36.99% (10.76kB) ⬇️
Specialization 2.13MB 2.14MB +0.42% (9.25kB) ⬇️
infer_expression_type_impl 11.36MB 11.35MB -0.07% (8.58kB) ⬇️
... 67 more

mtshiba added 13 commits March 11, 2026 16:29
…union

# Conflicts:
#	crates/ruff_benchmark/benches/ty.rs
#	crates/ty_python_semantic/resources/mdtest/narrow/isinstance.md
#	crates/ty_python_semantic/resources/mdtest/snapshots/isinstance.md_-_Narrowing_for_`isins…_-_`classinfo`_is_an_in…_(eeef56c0ef87a30b).snap
#	crates/ty_python_semantic/resources/mdtest/snapshots/issubclass.md_-_Narrowing_for_`issub…_-_`classinfo`_is_an_in…_(7bb66a0f412caac1).snap
#	crates/ty_python_semantic/src/types/known_instance.rs
#	crates/ty_python_semantic/src/types/type_alias.rs
#	crates/ty_server/tests/e2e/snapshots/e2e__signature_help__works_in_function_name.snap
astral-sh#24773 (CycleDetector improvement) preserves alias names through the
recursive cycle path instead of falling back to `Type::any()`. This both:

- restores the alias-name view in `Node.Child` / `JsonValue` recursive
  examples (no more `Any` leakage), and
- shortens fixpoint iteration for `infer_implicit_assignment_value_type`
  in deeply recursive cases, fixing the CI timeout on
  `external/pydantic.md` and `external/sqlmodel.md`.

mdtest assertions for `implicit_type_aliases.md` updated to match the
improved alias-name preservation.
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.

Do not expand PEP-613 type aliases on hover ty hangs on combination of self-ref Union, dataclass and Protocol

2 participants