microsoft / pyright

Static Type Checker for Python
Other
13.12k stars 1.4k forks source link

Further simplified TypeVar constraint tracking and solving. Removed t… #8683

Closed erictraut closed 1 month ago

erictraut commented 1 month ago

…he need to track separate constraints for dest and src.

github-actions[bot] commented 1 month ago

Diff from mypy_primer, showing the effect of this PR on open source code:


anyio (https://github.com/agronholm/anyio)
+   /tmp/mypy_primer/projects/anyio/src/anyio/_backends/_asyncio.py:905:13 - error: Argument of type "partial[None]" cannot be assigned to parameter "func" of type "(*PosArgsT@run_sync_from_thread) -> T_Retval@run_sync_from_thread" in function "run_sync_from_thread"
+     Type "partial[None]" is incompatible with type "((func: (*PosArgsT@_call_func) -> (Awaitable[T_Retval@_call_func] | T_Retval@_call_func), args: tuple[*PosArgsT@_call_func], kwargs: dict[str, Any], future: Future[T_Retval@_call_func]) -> Coroutine[Any, Any, None], (*PosArgsT@_spawn_task_from_thread) -> (Awaitable[T_Retval@_spawn_task_from_thread] | T_Retval@_spawn_task_from_thread), tuple[*PosArgsT@_spawn_task_from_thread], dict[str, Any], Future[T_Retval@_spawn_task_from_thread]) -> None"
+       Parameter 3: type "tuple[*PosArgsT@_spawn_task_from_thread]" is incompatible with type "*PosArgsT@start_soon"
+         Type "*tuple[tuple[*PosArgsT@_spawn_task_from_thread]]" is incompatible with type "*tuple[(*PosArgsT@_call_func) -> (Awaitable[T_Retval@_call_func] | T_Retval@_call_func), tuple[*PosArgsT@_call_func], dict[str, Any], Future[T_Retval@_call_func]]"
+           "*tuple[tuple[*PosArgsT@_spawn_task_from_thread]]" is incompatible with "*tuple[(*PosArgsT@_call_func) -> (Awaitable[T_Retval@_call_func] | T_Retval@_call_func), tuple[*PosArgsT@_call_func], dict[str, Any], Future[T_Retval@_call_func]]"
+             Tuple size mismatch; expected 4 but received 1
+       Parameter 4: type "dict[str, Any]" is incompatible with type "*PosArgsT@start_soon"
+         Type "*tuple[dict[str, Any]]" is incompatible with type "*tuple[(*PosArgsT@_call_func) -> (Awaitable[T_Retval@_call_func] | T_Retval@_call_func), tuple[*PosArgsT@_call_func], dict[str, Any], Future[T_Retval@_call_func]]"
+           "*tuple[dict[str, Any]]" is incompatible with "*tuple[(*PosArgsT@_call_func) -> (Awaitable[T_Retval@_call_func] | T_Retval@_call_func), tuple[*PosArgsT@_call_func], dict[str, Any], Future[T_Retval@_call_func]]"
+     ... (reportArgumentType)
- 33 errors, 1 warning, 0 informations 
+ 34 errors, 1 warning, 0 informations 

mypy (https://github.com/python/mypy)
-   /tmp/mypy_primer/projects/mypy/mypy/typeshed/stdlib/contextvars.pyi:57:9 - error: Overload 3 for "get" will never be used because its parameters overlap overload 2 (reportOverlappingOverload)
- 1739 errors, 108 warnings, 0 informations 
+ 1738 errors, 108 warnings, 0 informations 

sympy (https://github.com/sympy/sympy)
-     Return type mismatch: base method returns type "tuple[Unknown, Unknown | Any] | None", override returns type "list[Unknown]"
+     Return type mismatch: base method returns type "tuple[Unknown, Unknown] | None", override returns type "list[Unknown]"
-       Type "list[Unknown]" is incompatible with type "tuple[Unknown, Unknown | Any] | None"
+       Type "list[Unknown]" is incompatible with type "tuple[Unknown, Unknown] | None"
-         "list[Unknown]" is incompatible with "tuple[Unknown, Unknown | Any]"
+         "list[Unknown]" is incompatible with "tuple[Unknown, Unknown]"

pip (https://github.com/pypa/pip)
-   /tmp/mypy_primer/projects/pip/src/pip/_vendor/typing_extensions.py:1028:20 - error: Expression of type "__call__" is incompatible with declared type "(self: Self@type, ...) -> Any"
-     Type "Overload[() -> dict[Unknown, Unknown], (**kwargs: _VT@dict) -> dict[str, _VT@dict], (map: SupportsKeysAndGetItem[_KT@dict, _VT@dict], /) -> dict[_KT@dict, _VT@dict], (map: SupportsKeysAndGetItem[str, _VT@dict], /, **kwargs: _VT@dict) -> dict[str, _VT@dict], (iterable: Iterable[tuple[_KT@dict, _VT@dict]], /) -> dict[_KT@dict, _VT@dict], (iterable: Iterable[tuple[str, _VT@dict]], /, **kwargs: _VT@dict) -> dict[str, _VT@dict], (iterable: Iterable[list[str]], /) -> dict[str, str], (iterable: Iterable[list[bytes]], /) -> dict[bytes, bytes]] | ((...) -> dict[_KT@dict, _VT@dict])" is incompatible with type "(self: Self@type, ...) -> Any"
-       No overloaded function matches type "(self: Self@type, ...) -> Any" (reportAssignmentType)
+   /tmp/mypy_primer/projects/pip/src/pip/_vendor/pkg_resources/__init__.py:832:9 - error: Overloaded implementation is not consistent with signature of overload 1
+     Function return type "list[_DistributionT@resolve]" is incompatible with type "list[Distribution]"
+       "list[_DistributionT@resolve]" is incompatible with "list[Distribution]"
+         Type parameter "_T@list" is invariant, but "_DistributionT@resolve" is not the same as "Distribution"
+         Consider switching from "list" to "Sequence" which is covariant (reportInconsistentOverload)
+   /tmp/mypy_primer/projects/pip/src/pip/_vendor/pkg_resources/__init__.py:832:9 - error: Overloaded implementation is not consistent with signature of overload 2
+     Function return type "list[_DistributionT@resolve]" is incompatible with type "list[Distribution]"
+       "list[_DistributionT@resolve]" is incompatible with "list[Distribution]"
+         Type parameter "_T@list" is invariant, but "_DistributionT@resolve" is not the same as "Distribution"
+         Consider switching from "list" to "Sequence" which is covariant (reportInconsistentOverload)
+   /tmp/mypy_primer/projects/pip/src/pip/_vendor/pkg_resources/__init__.py:962:9 - error: Overloaded implementation is not consistent with signature of overload 1
+     Function return type "tuple[list[_DistributionT@find_plugins], dict[Distribution, Exception]]" is incompatible with type "tuple[list[Distribution], dict[Distribution, Exception]]"
+       "tuple[list[_DistributionT@find_plugins], dict[Distribution, Exception]]" is incompatible with "tuple[list[Distribution], dict[Distribution, Exception]]"
+         Tuple entry 1 is incorrect type
+           "list[_DistributionT@find_plugins]" is incompatible with "list[Distribution]"
+             Type parameter "_T@list" is invariant, but "_DistributionT@find_plugins" is not the same as "Distribution"
+             Consider switching from "list" to "Sequence" which is covariant (reportInconsistentOverload)
+   /tmp/mypy_primer/projects/pip/src/pip/_vendor/pkg_resources/__init__.py:962:9 - error: Overloaded implementation is not consistent with signature of overload 2
+     Function return type "tuple[list[_DistributionT@find_plugins], dict[Distribution, Exception]]" is incompatible with type "tuple[list[Distribution], dict[Distribution, Exception]]"
+       "tuple[list[_DistributionT@find_plugins], dict[Distribution, Exception]]" is incompatible with "tuple[list[Distribution], dict[Distribution, Exception]]"
+         Tuple entry 1 is incorrect type
+           "list[_DistributionT@find_plugins]" is incompatible with "list[Distribution]"
+             Type parameter "_T@list" is invariant, but "_DistributionT@find_plugins" is not the same as "Distribution"
+             Consider switching from "list" to "Sequence" which is covariant (reportInconsistentOverload)
- 1832 errors, 42 warnings, 0 informations 
+ 1835 errors, 42 warnings, 0 informations 

core (https://github.com/home-assistant/core)
-   /tmp/mypy_primer/projects/core/homeassistant/helpers/config_validation.py:299:5 - error: Overloaded implementation is not consistent with signature of overload 3
-     Type "(value: _T@ensure_list | None) -> (list[_T@ensure_list] | list[Any])" is incompatible with type "(value: list[_T@ensure_list] | _T@ensure_list) -> list[_T@ensure_list]"
-       Parameter 1: type "list[_T@ensure_list] | _T@ensure_list" is incompatible with type "_T@ensure_list | None" (reportInconsistentOverload)
-   /tmp/mypy_primer/projects/core/homeassistant/util/hass_dict.pyi:93:9 - error: Overload 6 for "pop" will never be used because its parameters overlap overload 5 (reportOverlappingOverload)
- 23839 errors, 354 warnings, 0 informations 
+ 23837 errors, 354 warnings, 0 informations 

steam.py (https://github.com/Gobot1234/steam.py)
+   /tmp/mypy_primer/projects/steam.py/steam/gateway.py:337:9 - error: Overloaded implementation is not consistent with signature of overload 3
+     Type "type[ProtoMsgsT@wait_for] | None" is incompatible with type "type[ProtoMsgT@wait_for]"
+     Type "None" is incompatible with type "type[ProtoMsgT@wait_for]"
+     Function return type "Future[ProtoMsgT@wait_for]" is incompatible with type "Future[ProtobufMessage]"
+       "Future[ProtoMsgT@wait_for]" is incompatible with "Future[ProtobufMessage]"
+         Type parameter "_T@Future" is invariant, but "ProtoMsgT@wait_for" is not the same as "ProtobufMessage" (reportInconsistentOverload)
+   /tmp/mypy_primer/projects/steam.py/steam/gateway.py:365:9 - error: Overloaded implementation is not consistent with signature of overload 3
+     Type "type[GCMsgsT@gc_wait_for] | None" is incompatible with type "type[GCMsgProtoT@gc_wait_for]"
+     Type "None" is incompatible with type "type[GCMsgProtoT@gc_wait_for]"
+     Function return type "Future[GCMsgProtoT@gc_wait_for]" is incompatible with type "Future[GCProtobufMessage]"
+       "Future[GCMsgProtoT@gc_wait_for]" is incompatible with "Future[GCProtobufMessage]"
+         Type parameter "_T@Future" is invariant, but "GCMsgProtoT@gc_wait_for" is not the same as "GCProtobufMessage" (reportInconsistentOverload)
+   /tmp/mypy_primer/projects/steam.py/steam/utils.py:539:9 - error: Overloaded implementation is not consistent with signature of overload 1
+     Function return type "_VT@ChainMap" is incompatible with type "MissingSentinel"
+       "object*" is incompatible with "MissingSentinel" (reportInconsistentOverload)
-     Type "(self: Self@Metal, other: SupportsMetal) -> Metal" is incompatible with type "(Metal, Metal) -> Metal"
+     Type "(self: Self@Metal, other: SupportsMetal) -> Metal" is incompatible with type "(Self@Metal, Self@Metal) -> Self@Metal"
-       Parameter 1: type "Metal" is incompatible with type "Self@Metal"
+       Function return type "Metal" is incompatible with type "Self@Metal"
+         Type "Metal" is incompatible with type "Self@Metal" (reportArgumentType)
+   /tmp/mypy_primer/projects/steam.py/steam/ext/tf2/currency.py:147:36 - error: Argument of type "Generator[Metal, None, None]" cannot be assigned to parameter "sequence" of type "Iterable[_T@reduce]" in function "reduce"
+     "Generator[Metal, None, None]" is incompatible with "Iterable[Self@Metal]"
+       Type parameter "_T_co@Iterable" is covariant, but "Metal" is not a subtype of "Self@Metal"
- 8468 errors, 93 warnings, 0 informations 
+ 8472 errors, 93 warnings, 0 informations 

xarray (https://github.com/pydata/xarray)
-   /tmp/mypy_primer/projects/xarray/xarray/core/rolling.py:232:24 - error: Expression of type "list[Any | _T@_mapping_to_list | None]" is incompatible with return type "list[_T@_mapping_to_list]" (reportReturnType)
-   /tmp/mypy_primer/projects/xarray/xarray/core/utils.py:471:9 - error: Overloaded implementation is not consistent with signature of overload 2
-     Function return type "V@FrozenMappingWarningOnValuesAccess | T@get" is incompatible with type "V@FrozenMappingWarningOnValuesAccess | None" (reportInconsistentOverload)
- 2518 errors, 108 warnings, 0 informations 
+ 2516 errors, 108 warnings, 0 informations 

spark (https://github.com/apache/spark)
-     Function return type "RDD[Tuple[K@sortByKey, V@sortByKey]]" is incompatible with type "RDD[Tuple[S@sortByKey, V@sortByKey]]"
+     Function return type "RDD[Tuple[K@sortByKey, V@sortByKey]]" is incompatible with type "RDD[Tuple[SupportsOrdering, V@sortByKey]]"
-       "RDD[Tuple[K@sortByKey, V@sortByKey]]" is incompatible with "RDD[Tuple[S@sortByKey, V@sortByKey]]"
+       "RDD[Tuple[K@sortByKey, V@sortByKey]]" is incompatible with "RDD[Tuple[SupportsOrdering, V@sortByKey]]"
-         Type parameter "T_co@RDD" is covariant, but "Tuple[K@sortByKey, V@sortByKey]" is not a subtype of "Tuple[S@sortByKey, V@sortByKey]"
+         Type parameter "T_co@RDD" is covariant, but "Tuple[K@sortByKey, V@sortByKey]" is not a subtype of "Tuple[SupportsOrdering, V@sortByKey]"
-           "Tuple[K@sortByKey, V@sortByKey]" is incompatible with "Tuple[S@sortByKey, V@sortByKey]"
+           "Tuple[K@sortByKey, V@sortByKey]" is incompatible with "Tuple[SupportsOrdering, V@sortByKey]"
+   /tmp/mypy_primer/projects/spark/python/pyspark/core/rdd.py:2539:9 - error: Overloaded implementation is not consistent with signature of overload 1
+     Function return type "List[S@top]" is incompatible with type "List[SupportsOrdering]"
+       "List[S@top]" is incompatible with "List[SupportsOrdering]"
+         Type parameter "_T@list" is invariant, but "S@top" is not the same as "SupportsOrdering"
+         Consider switching from "list" to "Sequence" which is covariant (reportInconsistentOverload)
+   /tmp/mypy_primer/projects/spark/python/pyspark/core/rdd.py:2596:9 - error: Overloaded implementation is not consistent with signature of overload 1
+     Function return type "List[S@takeOrdered]" is incompatible with type "List[SupportsOrdering]"
+       "List[S@takeOrdered]" is incompatible with "List[SupportsOrdering]"
+         Type parameter "_T@list" is invariant, but "S@takeOrdered" is not the same as "SupportsOrdering"
+         Consider switching from "list" to "Sequence" which is covariant (reportInconsistentOverload)
+   /tmp/mypy_primer/projects/spark/python/pyspark/streaming/kinesis.py:91:9 - error: Overloaded implementation is not consistent with signature of overload 2
+     Function return type "DStream[T@createStream]" is incompatible with type "DStream[str | None]"
+       "DStream[T@createStream]" is incompatible with "DStream[str | None]"
+         Type parameter "T_co@DStream" is covariant, but "T@createStream" is not a subtype of "str | None"
+           Type "T@createStream" is incompatible with type "str | None"
+             "object*" is incompatible with "str"
+             "object*" is incompatible with "None" (reportInconsistentOverload)
- 24179 errors, 279 warnings, 0 informations 
+ 24182 errors, 279 warnings, 0 informations 

setuptools (https://github.com/pypa/setuptools)
+   /tmp/mypy_primer/projects/setuptools/pkg_resources/__init__.py:840:9 - error: Overloaded implementation is not consistent with signature of overload 1
+     Function return type "list[_DistributionT@resolve]" is incompatible with type "list[Distribution]"
+       "list[_DistributionT@resolve]" is incompatible with "list[Distribution]"
+         Type parameter "_T@list" is invariant, but "_DistributionT@resolve" is not the same as "Distribution"
+         Consider switching from "list" to "Sequence" which is covariant (reportInconsistentOverload)
+   /tmp/mypy_primer/projects/setuptools/pkg_resources/__init__.py:840:9 - error: Overloaded implementation is not consistent with signature of overload 2
+     Function return type "list[_DistributionT@resolve]" is incompatible with type "list[Distribution]"
+       "list[_DistributionT@resolve]" is incompatible with "list[Distribution]"
+         Type parameter "_T@list" is invariant, but "_DistributionT@resolve" is not the same as "Distribution"
+         Consider switching from "list" to "Sequence" which is covariant (reportInconsistentOverload)
+   /tmp/mypy_primer/projects/setuptools/pkg_resources/__init__.py:970:9 - error: Overloaded implementation is not consistent with signature of overload 1
+     Function return type "tuple[list[_DistributionT@find_plugins], dict[Distribution, Exception]]" is incompatible with type "tuple[list[Distribution], dict[Distribution, Exception]]"
+       "tuple[list[_DistributionT@find_plugins], dict[Distribution, Exception]]" is incompatible with "tuple[list[Distribution], dict[Distribution, Exception]]"
+         Tuple entry 1 is incorrect type
+           "list[_DistributionT@find_plugins]" is incompatible with "list[Distribution]"
+             Type parameter "_T@list" is invariant, but "_DistributionT@find_plugins" is not the same as "Distribution"
+             Consider switching from "list" to "Sequence" which is covariant (reportInconsistentOverload)
+   /tmp/mypy_primer/projects/setuptools/pkg_resources/__init__.py:970:9 - error: Overloaded implementation is not consistent with signature of overload 2
+     Function return type "tuple[list[_DistributionT@find_plugins], dict[Distribution, Exception]]" is incompatible with type "tuple[list[Distribution], dict[Distribution, Exception]]"
+       "tuple[list[_DistributionT@find_plugins], dict[Distribution, Exception]]" is incompatible with "tuple[list[Distribution], dict[Distribution, Exception]]"
+         Tuple entry 1 is incorrect type
+           "list[_DistributionT@find_plugins]" is incompatible with "list[Distribution]"
+             Type parameter "_T@list" is invariant, but "_DistributionT@find_plugins" is not the same as "Distribution"
+             Consider switching from "list" to "Sequence" which is covariant (reportInconsistentOverload)
-   /tmp/mypy_primer/projects/setuptools/setuptools/_vendor/typing_extensions.py:1028:20 - error: Expression of type "__call__" is incompatible with declared type "(self: Self@type, ...) -> Any"
-     Type "Overload[() -> dict[Unknown, Unknown], (**kwargs: _VT@dict) -> dict[str, _VT@dict], (map: SupportsKeysAndGetItem[_KT@dict, _VT@dict], /) -> dict[_KT@dict, _VT@dict], (map: SupportsKeysAndGetItem[str, _VT@dict], /, **kwargs: _VT@dict) -> dict[str, _VT@dict], (iterable: Iterable[tuple[_KT@dict, _VT@dict]], /) -> dict[_KT@dict, _VT@dict], (iterable: Iterable[tuple[str, _VT@dict]], /, **kwargs: _VT@dict) -> dict[str, _VT@dict], (iterable: Iterable[list[str]], /) -> dict[str, str], (iterable: Iterable[list[bytes]], /) -> dict[bytes, bytes]] | ((...) -> dict[_KT@dict, _VT@dict])" is incompatible with type "(self: Self@type, ...) -> Any"
-       No overloaded function matches type "(self: Self@type, ...) -> Any" (reportAssignmentType)
- 2694 errors, 59 warnings, 0 informations 
+ 2697 errors, 59 warnings, 0 informations 

jax (https://github.com/google/jax)
+   /tmp/mypy_primer/projects/jax/jax/_src/ad_checkpoint.py:406:24 - error: "partial[partial[_T@partial]]" is not iterable
+     "__iter__" method not defined (reportGeneralTypeIssues)
+   /tmp/mypy_primer/projects/jax/jax/_src/api.py:530:29 - error: "partial[partial[_T@partial]]" is not iterable
+     "__iter__" method not defined (reportGeneralTypeIssues)
+   /tmp/mypy_primer/projects/jax/jax/_src/api.py:702:26 - error: Argument of type "partial[partial[_T@partial]]" cannot be assigned to parameter "fun" of type "WrappedFun" in function "_vjp"
+     "partial[partial[_T@partial]]" is incompatible with "WrappedFun" (reportArgumentType)
+   /tmp/mypy_primer/projects/jax/jax/_src/api.py:705:11 - error: Argument of type "partial[partial[_T@partial]]" cannot be assigned to parameter "fun" of type "WrappedFun" in function "_vjp"
+     "partial[partial[_T@partial]]" is incompatible with "WrappedFun" (reportArgumentType)
+   /tmp/mypy_primer/projects/jax/jax/_src/api.py:820:41 - error: Argument of type "partial[partial[_T@partial]]" cannot be assigned to parameter "fun" of type "WrappedFun" in function "_jvp" (reportArgumentType)
+   /tmp/mypy_primer/projects/jax/jax/_src/api.py:823:41 - error: Argument of type "partial[partial[_T@partial]]" cannot be assigned to parameter "fun" of type "WrappedFun" in function "_jvp" (reportArgumentType)
+   /tmp/mypy_primer/projects/jax/jax/_src/api.py:908:26 - error: Argument of type "partial[partial[_T@partial]]" cannot be assigned to parameter "fun" of type "WrappedFun" in function "_vjp"
+     "partial[partial[_T@partial]]" is incompatible with "WrappedFun" (reportArgumentType)
+   /tmp/mypy_primer/projects/jax/jax/_src/api.py:910:31 - error: Argument of type "partial[partial[_T@partial]]" cannot be assigned to parameter "fun" of type "WrappedFun" in function "_vjp"
+     "partial[partial[_T@partial]]" is incompatible with "WrappedFun" (reportArgumentType)
+   /tmp/mypy_primer/projects/jax/jax/_src/api.py:1221:26 - error: "partial[partial[_T@partial]]" is not iterable
+     "__iter__" method not defined (reportGeneralTypeIssues)
+   /tmp/mypy_primer/projects/jax/jax/_src/api.py:1679:18 - error: "partial[partial[_T@partial]]" is not iterable
+     "__iter__" method not defined (reportGeneralTypeIssues)
+   /tmp/mypy_primer/projects/jax/jax/_src/api.py:1681:24 - error: "partial[partial[_T@partial]]" is not iterable
+     "__iter__" method not defined (reportGeneralTypeIssues)
+   /tmp/mypy_primer/projects/jax/jax/_src/api.py:1949:26 - error: "partial[partial[_T@partial]]" is not iterable
+     "__iter__" method not defined (reportGeneralTypeIssues)
+   /tmp/mypy_primer/projects/jax/jax/_src/api.py:1955:31 - error: "partial[partial[_T@partial]]" is not iterable
+     "__iter__" method not defined (reportGeneralTypeIssues)
+   /tmp/mypy_primer/projects/jax/jax/_src/api.py:2044:29 - error: "partial[partial[_T@partial]]" is not iterable
+     "__iter__" method not defined (reportGeneralTypeIssues)
+   /tmp/mypy_primer/projects/jax/jax/_src/api.py:2046:29 - error: "partial[partial[_T@partial]]" is not iterable
+     "__iter__" method not defined (reportGeneralTypeIssues)
+   /tmp/mypy_primer/projects/jax/jax/_src/api.py:2195:26 - error: "partial[partial[_T@partial]]" is not iterable
+     "__iter__" method not defined (reportGeneralTypeIssues)
+   /tmp/mypy_primer/projects/jax/jax/_src/api.py:2199:31 - error: "partial[partial[_T@partial]]" is not iterable
+     "__iter__" method not defined (reportGeneralTypeIssues)
+   /tmp/mypy_primer/projects/jax/jax/_src/api.py:2253:24 - error: "partial[partial[_T@partial]]" is not iterable
+     "__iter__" method not defined (reportGeneralTypeIssues)
+   /tmp/mypy_primer/projects/jax/jax/_src/api_util.py:435:17 - error: "partial[partial[_T@partial]]" is not iterable
+     "__iter__" method not defined (reportGeneralTypeIssues)
+   /tmp/mypy_primer/projects/jax/jax/_src/checkify.py:362:32 - error: "partial[partial[_T@partial]]" is not iterable
+     "__iter__" method not defined (reportGeneralTypeIssues)
+   /tmp/mypy_primer/projects/jax/jax/_src/checkify.py:747:19 - error: "partial[partial[_T@partial]]" is not iterable
+     "__iter__" method not defined (reportGeneralTypeIssues)
+   /tmp/mypy_primer/projects/jax/jax/_src/checkify.py:949:34 - error: "partial[partial[_T@partial]]" is not iterable
+     "__iter__" method not defined (reportGeneralTypeIssues)
+   /tmp/mypy_primer/projects/jax/jax/_src/checkify.py:952:23 - error: "partial[partial[_T@partial]]" is not iterable
+     "__iter__" method not defined (reportGeneralTypeIssues)
+   /tmp/mypy_primer/projects/jax/jax/_src/checkify.py:1000:34 - error: "partial[partial[_T@partial]]" is not iterable
+     "__iter__" method not defined (reportGeneralTypeIssues)
+   /tmp/mypy_primer/projects/jax/jax/_src/checkify.py:1013:34 - error: "partial[partial[_T@partial]]" is not iterable
+     "__iter__" method not defined (reportGeneralTypeIssues)
+   /tmp/mypy_primer/projects/jax/jax/_src/checkify.py:1132:22 - error: "partial[partial[_T@partial]]" is not iterable
+     "__iter__" method not defined (reportGeneralTypeIssues)
+   /tmp/mypy_primer/projects/jax/jax/_src/core.py:2292:28 - error: Argument of type "partial[partial[_T@partial]]" cannot be assigned to parameter "f" of type "WrappedFun" in function "annotate"
+     "partial[partial[_T@partial]]" is incompatible with "WrappedFun" (reportArgumentType)
+   /tmp/mypy_primer/projects/jax/jax/_src/core.py:2297:26 - error: "partial[partial[_T@partial]]" is not iterable
+     "__iter__" method not defined (reportGeneralTypeIssues)
+   /tmp/mypy_primer/projects/jax/jax/_src/core.py:2341:7 - error: Method "get_bind_params" overrides class "CallPrimitive" in an incompatible manner
+     Return type mismatch: base method returns type "tuple[list[WrappedFun | partial[partial[_T@partial]]], dict[Unknown, Unknown]]", override returns type "tuple[list[WrappedFun], dict[Unknown, Unknown]]"
+       "tuple[list[WrappedFun], dict[Unknown, Unknown]]" is incompatible with "tuple[list[WrappedFun | partial[partial[_T@partial]]], dict[Unknown, Unknown]]"
+         Tuple entry 1 is incorrect type
+           "list[WrappedFun]" is incompatible with "list[WrappedFun | partial[partial[_T@partial]]]"
+             Type parameter "_T@list" is invariant, but "WrappedFun" is not the same as "WrappedFun | partial[partial[_T@partial]]"
+             Consider switching from "list" to "Sequence" which is covariant (reportIncompatibleMethodOverride)
+   /tmp/mypy_primer/projects/jax/jax/_src/core.py:2418:26 - error: "partial[partial[_T@partial]]" is not iterable
+     "__iter__" method not defined (reportGeneralTypeIssues)
+   /tmp/mypy_primer/projects/jax/jax/_src/custom_batching.py:69:26 - error: "partial[partial[_T@partial]]" is not iterable
+     "__iter__" method not defined (reportGeneralTypeIssues)
+   /tmp/mypy_primer/projects/jax/jax/_src/custom_batching.py:136:17 - error: "partial[partial[_T@partial]]" is not iterable
+     "__iter__" method not defined (reportGeneralTypeIssues)
+   /tmp/mypy_primer/projects/jax/jax/_src/custom_batching.py:137:7 - error: Expression of type "partial[partial[_T@partial]]" is incompatible with declared type "WrappedFun"
+     "partial[partial[_T@partial]]" is incompatible with "WrappedFun" (reportAssignmentType)
+   /tmp/mypy_primer/projects/jax/jax/_src/custom_batching.py:203:55 - error: "partial[partial[_T@partial]]" is not iterable
+     "__iter__" method not defined (reportGeneralTypeIssues)
+   /tmp/mypy_primer/projects/jax/jax/_src/custom_derivatives.py:257:27 - error: "partial[partial[_T@partial]]" is not iterable
+     "__iter__" method not defined (reportGeneralTypeIssues)
+   /tmp/mypy_primer/projects/jax/jax/_src/custom_derivatives.py:258:27 - error: "partial[partial[partial[partial[partial[partial[partial[partial[_T@partial]]]]]]]]" is not iterable
+     "__iter__" method not defined (reportGeneralTypeIssues)
+   /tmp/mypy_primer/projects/jax/jax/_src/custom_derivatives.py:274:10 - error: Argument of type "partial[partial[partial[partial[_T@partial]]]]" cannot be assigned to parameter "func" of type "(...) -> _T@partial" in function "__new__"
+     Type "partial[partial[partial[partial[_T@partial]]]]" is incompatible with type "(...) -> partial[partial[partial[partial[partial[partial[partial[partial[partial[_T@partial]]]]]]]]]"
+       Function return type "partial[partial[partial[_T@partial]]]" is incompatible with type "partial[partial[partial[partial[partial[partial[partial[partial[partial[_T@partial]]]]]]]]]"
+         "partial[partial[partial[_T@partial]]]" is incompatible with "partial[partial[partial[partial[partial[partial[partial[partial[partial[_T@partial]]]]]]]]]"
+           Type parameter "_T@partial" is invariant, but "partial[partial[_T@partial]]" is not the same as "partial[partial[partial[partial[partial[partial[partial[partial[_T@partial]]]]]]]]" (reportArgumentType)
+   /tmp/mypy_primer/projects/jax/jax/_src/custom_derivatives.py:355:28 - error: "partial[partial[partial[partial[partial[partial[partial[partial[_T@partial]]]]]]]]" is not iterable
+     "__iter__" method not defined (reportGeneralTypeIssues)
+   /tmp/mypy_primer/projects/jax/jax/_src/custom_derivatives.py:357:28 - error: "partial[partial[partial[partial[partial[partial[partial[partial[_T@partial]]]]]]]]" is not iterable
+     "__iter__" method not defined (reportGeneralTypeIssues)
+   /tmp/mypy_primer/projects/jax/jax/_src/custom_derivatives.py:400:10 - error: Argument of type "partial[partial[partial[partial[_T@partial]]]]" cannot be assigned to parameter "func" of type "(...) -> _T@partial" in function "__new__"
+     Type "partial[partial[partial[partial[_T@partial]]]]" is incompatible with type "(...) -> partial[partial[partial[partial[partial[partial[partial[partial[partial[_T@partial]]]]]]]]]"

... (truncated 248 lines) ...

trio (https://github.com/python-trio/trio)
+   /tmp/mypy_primer/projects/trio/src/trio/_core/_tests/test_guest_mode.py:451:38 - error: Argument of type "(callback: (*_Ts@call_soon_threadsafe) -> object, *args: *_Ts@call_soon_threadsafe) -> Handle" cannot be assigned to parameter "run_sync_soon_threadsafe" of type "(() -> object) -> object" in function "start_guest_run"
+     Type "(callback: (*_Ts@call_soon_threadsafe) -> object, *args: *_Ts@call_soon_threadsafe) -> Handle" is incompatible with type "(() -> object) -> object"
+       Parameter 1: type "() -> object" is incompatible with type "(*_Ts@call_soon_threadsafe) -> object"
+         Type "() -> object" is incompatible with type "(*_Ts@call_soon_threadsafe) -> object"
+           Parameter 1: type "*_Ts@call_soon_threadsafe" is incompatible with type "*tuple[()]"
+             "*tuple[object, ...]" is incompatible with "*tuple[()]" (reportArgumentType)
-     Type "*tuple[(fd: int | _HasFileNo) -> Coroutine[Any, Any, None], socket]" is incompatible with type "*tuple[(**ArgsT@allow_OSError) -> Awaitable[object]]" (reportArgumentType)
+     Type "*tuple[(fd: int | _HasFileNo) -> Coroutine[Any, Any, None], socket]" is incompatible with type "*tuple[(**ArgsT@allow_OSError) -> Awaitable[object]]"
+       "*tuple[(fd: int | _HasFileNo) -> Coroutine[Any, Any, None], socket]" is incompatible with "*tuple[(**ArgsT@allow_OSError) -> Awaitable[object]]"
+         Tuple size mismatch; expected 1 but received 2 (reportArgumentType)
-     Type "*tuple[(fd: int | _HasFileNo) -> Coroutine[Any, Any, None], socket]" is incompatible with type "*tuple[(**ArgsT@allow_OSError) -> Awaitable[object]]" (reportArgumentType)
+     Type "*tuple[(fd: int | _HasFileNo) -> Coroutine[Any, Any, None], socket]" is incompatible with type "*tuple[(**ArgsT@allow_OSError) -> Awaitable[object]]"
+       "*tuple[(fd: int | _HasFileNo) -> Coroutine[Any, Any, None], socket]" is incompatible with "*tuple[(**ArgsT@allow_OSError) -> Awaitable[object]]"
+         Tuple size mismatch; expected 1 but received 2 (reportArgumentType)

... (truncated 30 lines) ...```