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/lowlevel.py
+ /tmp/mypy_primer/projects/anyio/src/anyio/lowlevel.py:139:29 - error: Argument of type "Self@RunVar[T@RunVar]" cannot be assigned to parameter "var" of type "RunVar[T@RunvarToken]" in function "__init__"
+ "RunVar[T@RunVar]*" is incompatible with "RunVar[_NoValueSet | T@RunVar]"
+ Type parameter "T@RunVar" is invariant, but "T@RunVar" is not the same as "_NoValueSet | T@RunVar" (reportArgumentType)
+ /tmp/mypy_primer/projects/anyio/src/anyio/lowlevel.py:141:16 - error: Expression of type "RunvarToken[_NoValueSet | T@RunVar]" is incompatible with return type "RunvarToken[T@RunVar]"
+ "RunvarToken[_NoValueSet | T@RunVar]" is incompatible with "RunvarToken[T@RunVar]"
+ Type parameter "T@RunvarToken" is invariant, but "_NoValueSet | T@RunVar" is not the same as "T@RunVar" (reportReturnType)
- /tmp/mypy_primer/projects/anyio/src/anyio/_core/_sockets.py:256:51 - error: Argument of type "str | bytes | PathLike[Any]" cannot be assigned to parameter "path" of type "str | bytes" in function "connect_unix" (reportArgumentType)
- /tmp/mypy_primer/projects/anyio/src/anyio/_core/_sockets.py:523:18 - error: No overloads for "create_unix_datagram_socket" match the provided arguments (reportCallIssue)
- /tmp/mypy_primer/projects/anyio/src/anyio/_core/_sockets.py:524:21 - error: Argument of type "str | bytes | PathLike[Any]" cannot be assigned to parameter "remote_path" of type "str | bytes" in function "create_unix_datagram_socket" (reportArgumentType)
- 34 errors, 1 warning, 0 informations
+ 33 errors, 1 warning, 0 informations
graphql-core (https://github.com/graphql-python/graphql-core)
+ /tmp/mypy_primer/projects/graphql-core/src/graphql/language/visitor.py:273:34 - error: Argument of type "tuple[Any | Node | int | None, Literal[VisitorActionEnum.REMOVE]]" cannot be assigned to parameter "object" of type "tuple[int | str, Node]" in function "append"
+ "Literal[VisitorActionEnum.REMOVE]" is incompatible with "Node" (reportArgumentType)
+ /tmp/mypy_primer/projects/graphql-core/src/graphql/language/visitor.py:284:26 - error: Argument of type "tuple[Any | Node | int | None, tuple[Unknown, ...] | Node | <subclass of VisitorActionEnum and Node> | Any]" cannot be assigned to parameter "object" of type "tuple[int | str, Node]" in function "append"
+ Type "tuple[Unknown, ...] | Node | <subclass of VisitorActionEnum and Node> | Any" is incompatible with type "Node"
+ "tuple[Unknown, ...]" is incompatible with "Node" (reportArgumentType)
+ /tmp/mypy_primer/projects/graphql-core/src/graphql/utilities/lexicographic_sort_schema.py
+ /tmp/mypy_primer/projects/graphql-core/src/graphql/utilities/lexicographic_sort_schema.py:53:35 - error: Argument of type "GraphQLList[Unknown] | GraphQLNonNull[Unknown] | GraphQLNamedType" cannot be assigned to parameter "type_" of type "GNT_co@GraphQLNonNull" in function "__init__"
+ Type "GraphQLList[Unknown] | GraphQLNonNull[Unknown] | GraphQLNamedType" is incompatible with type "GraphQLNullableType" (reportArgumentType)
- 137 errors, 35 warnings, 0 informations
+ 140 errors, 35 warnings, 0 informations
sympy (https://github.com/sympy/sympy)
- "Basic" is incompatible with protocol "Iterable[_T@set]"
+ "Basic" is incompatible with protocol "Iterable[Unknown]"
- /tmp/mypy_primer/projects/sympy/sympy/tensor/tensor.py:3063:16 - error: Expression of type "list[Basic]" is incompatible with return type "list[TensorIndex]"
- "list[Basic]" is incompatible with "list[TensorIndex]"
- Type parameter "_T@list" is invariant, but "Basic" is not the same as "TensorIndex"
- Consider switching from "list" to "Sequence" which is covariant (reportReturnType)
+ /tmp/mypy_primer/projects/sympy/sympy/tensor/tensor.py:3063:21 - error: Argument of type "Tuple" cannot be assigned to parameter "iterable" of type "Iterable[_T@list]" in function "__init__"
+ "Tuple" is incompatible with protocol "Iterable[TensorIndex]"
+ "__iter__" is an incompatible type
+ Type "() -> Iterator[Basic]" is incompatible with type "() -> Iterator[_T_co@Iterable]"
+ Function return type "Iterator[Basic]" is incompatible with type "Iterator[_T_co@Iterable]"
+ "Iterator[Basic]" is incompatible with "Iterator[_T_co@Iterable]" (reportArgumentType)
pyodide (https://github.com/pyodide/pyodide)
+ /tmp/mypy_primer/projects/pyodide/src/py/pyodide/console.py:360:46 - error: Argument of type "_WriteStream" cannot be assigned to parameter "new_target" of type "_T_io@redirect_stdout" in function "__init__"
+ Type "_WriteStream" is incompatible with type "IO[str] | None"
+ Type "_WriteStream" is incompatible with type "IO[str] | None"
+ "_WriteStream" is incompatible with "IO[str]"
+ "_WriteStream" is incompatible with "None" (reportArgumentType)
+ /tmp/mypy_primer/projects/pyodide/src/py/pyodide/console.py:364:46 - error: Argument of type "_WriteStream" cannot be assigned to parameter "new_target" of type "_T_io@redirect_stderr" in function "__init__"
+ Type "_WriteStream" is incompatible with type "IO[str] | None"
+ Type "_WriteStream" is incompatible with type "IO[str] | None"
+ "_WriteStream" is incompatible with "IO[str]"
+ "_WriteStream" is incompatible with "None" (reportArgumentType)
- 735 errors, 16 warnings, 0 informations
+ 737 errors, 16 warnings, 0 informations
cloud-init (https://github.com/canonical/cloud-init)
- /tmp/mypy_primer/projects/cloud-init/cloudinit/config/schema.py:1250:12 - error: Expression of type "list[Unknown | str | bytes]" is incompatible with return type "List[str]"
+ /tmp/mypy_primer/projects/cloud-init/cloudinit/config/schema.py:1250:17 - error: Argument of type "Generator[Unknown | str | bytes, Unknown, None]" cannot be assigned to parameter "iterable" of type "Iterable[_T@list]" in function "__init__"
- "list[Unknown | str | bytes]" is incompatible with "List[str]"
+ "Generator[Unknown | str | bytes, Unknown, None]" is incompatible with "Iterable[str]"
- Type parameter "_T@list" is invariant, but "Unknown | str | bytes" is not the same as "str"
+ Type parameter "_T_co@Iterable" is covariant, but "Unknown | str | bytes" is not a subtype of "str"
- Consider switching from "list" to "Sequence" which is covariant (reportReturnType)
+ Type "Unknown | str | bytes" is incompatible with type "str"
+ "bytes" is incompatible with "str" (reportArgumentType)
scikit-learn (https://github.com/scikit-learn/scikit-learn)
+ /tmp/mypy_primer/projects/scikit-learn/sklearn/model_selection/tests/test_validation.py:2143:31 - error: Argument of type "Unknown | Any | list[Unknown]" cannot be assigned to parameter "return_train_score" of type "bool" in function "_fit_and_score"
+ Type "Unknown | Any | list[Unknown]" is incompatible with type "bool"
+ "list[Unknown]" is incompatible with "bool" (reportArgumentType)
+ /tmp/mypy_primer/projects/scikit-learn/sklearn/model_selection/tests/test_validation.py:2143:31 - error: Argument of type "Unknown | Any | list[Unknown]" cannot be assigned to parameter "return_parameters" of type "bool" in function "_fit_and_score"
+ Type "Unknown | Any | list[Unknown]" is incompatible with type "bool"
+ "list[Unknown]" is incompatible with "bool" (reportArgumentType)
+ /tmp/mypy_primer/projects/scikit-learn/sklearn/model_selection/tests/test_validation.py:2143:31 - error: Argument of type "Unknown | Any | list[Unknown]" cannot be assigned to parameter "return_n_test_samples" of type "bool" in function "_fit_and_score"
+ Type "Unknown | Any | list[Unknown]" is incompatible with type "bool"
+ "list[Unknown]" is incompatible with "bool" (reportArgumentType)
+ /tmp/mypy_primer/projects/scikit-learn/sklearn/model_selection/tests/test_validation.py:2143:31 - error: Argument of type "Unknown | Any | list[Unknown]" cannot be assigned to parameter "return_times" of type "bool" in function "_fit_and_score"
+ Type "Unknown | Any | list[Unknown]" is incompatible with type "bool"
+ "list[Unknown]" is incompatible with "bool" (reportArgumentType)
+ /tmp/mypy_primer/projects/scikit-learn/sklearn/model_selection/tests/test_validation.py:2143:31 - error: Argument of type "Unknown | Any | list[Unknown]" cannot be assigned to parameter "return_estimator" of type "bool" in function "_fit_and_score"
+ Type "Unknown | Any | list[Unknown]" is incompatible with type "bool"
+ "list[Unknown]" is incompatible with "bool" (reportArgumentType)
+ /tmp/mypy_primer/projects/scikit-learn/sklearn/tests/test_pipeline.py:1425:49 - error: Argument of type "list[tuple[Literal['transf'], Transf] | tuple[str, None] | tuple[Literal['clf'], FitParamT]]" cannot be assigned to parameter "steps" of type "Unknown" in function "__init__"
+ Type "tuple[str, None]" is incompatible with type "tuple[str, Transf] | tuple[str, FitParamT]"
+ "tuple[str, None]" is incompatible with "tuple[str, Transf]"
+ Tuple entry 2 is incorrect type
+ "None" is incompatible with "Transf"
+ "tuple[str, None]" is incompatible with "tuple[str, FitParamT]"
+ Tuple entry 2 is incorrect type
+ "None" is incompatible with "FitParamT" (reportArgumentType)
+ /tmp/mypy_primer/projects/scikit-learn/sklearn/tests/test_pipeline.py:1434:25 - error: Argument of type "list[tuple[Literal['transf'], Transf] | tuple[str, str] | tuple[Literal['clf'], FitParamT]]" cannot be assigned to parameter "steps" of type "Unknown" in function "__init__"
+ Type "tuple[str, str]" is incompatible with type "tuple[str, Transf] | tuple[str, FitParamT]"
+ "tuple[str, str]" is incompatible with "tuple[str, Transf]"
+ Tuple entry 2 is incorrect type
+ "str" is incompatible with "Transf"
+ "tuple[str, str]" is incompatible with "tuple[str, FitParamT]"
+ Tuple entry 2 is incorrect type
+ "str" is incompatible with "FitParamT" (reportArgumentType)
+ /tmp/mypy_primer/projects/scikit-learn/sklearn/tests/test_pipeline.py:1443:49 - error: Argument of type "list[tuple[Literal['transf'], Transf] | tuple[str, None]]" cannot be assigned to parameter "steps" of type "Unknown" in function "__init__"
+ Type "tuple[str, None]" is incompatible with type "tuple[str, Transf] | tuple[str, FitParamT]"
+ "tuple[str, None]" is incompatible with "tuple[str, Transf]"
+ Tuple entry 2 is incorrect type
+ "None" is incompatible with "Transf"
+ "tuple[str, None]" is incompatible with "tuple[str, FitParamT]"
+ Tuple entry 2 is incorrect type
+ "None" is incompatible with "FitParamT" (reportArgumentType)
+ /tmp/mypy_primer/projects/scikit-learn/sklearn/tests/test_pipeline.py:1448:26 - error: Argument of type "list[tuple[str, None] | tuple[str, Mult]]" cannot be assigned to parameter "steps" of type "Unknown" in function "__init__"
+ Type "tuple[str, None]" is incompatible with type "tuple[str, Transf] | tuple[str, FitParamT]"
+ "tuple[str, None]" is incompatible with "tuple[str, Transf]"
+ Tuple entry 2 is incorrect type
+ "None" is incompatible with "Transf"
+ "tuple[str, None]" is incompatible with "tuple[str, FitParamT]"
+ Tuple entry 2 is incorrect type
+ "None" is incompatible with "FitParamT"
+ Type "tuple[str, Mult]" is incompatible with type "tuple[str, Transf] | tuple[str, FitParamT]" (reportArgumentType)
+ /tmp/mypy_primer/projects/scikit-learn/sklearn/tests/test_pipeline.py:1453:26 - error: Argument of type "list[tuple[str, str] | tuple[str, Mult]]" cannot be assigned to parameter "steps" of type "Unknown" in function "__init__"
+ Type "tuple[str, str]" is incompatible with type "tuple[str, Transf] | tuple[str, FitParamT]"
+ "tuple[str, str]" is incompatible with "tuple[str, Transf]"
+ Tuple entry 2 is incorrect type
+ "str" is incompatible with "Transf"
+ "tuple[str, str]" is incompatible with "tuple[str, FitParamT]"
+ Tuple entry 2 is incorrect type
+ "str" is incompatible with "FitParamT"
+ Type "tuple[str, Mult]" is incompatible with type "tuple[str, Transf] | tuple[str, FitParamT]" (reportArgumentType)
+ /tmp/mypy_primer/projects/scikit-learn/sklearn/tests/test_pipeline.py:1463:30 - error: Argument of type "list[tuple[Literal['mult1'], Literal['drop']] | tuple[Literal['mult2'], Mult] | tuple[Literal['mult3'], Literal['drop']]]" cannot be assigned to parameter "transformer_list" of type "Unknown" in function "__init__"
+ "Literal['drop']" is incompatible with "Mult"
+ "Literal['drop']" is incompatible with "Mult" (reportArgumentType)
- 10304 errors, 59 warnings, 0 informations
+ 10315 errors, 59 warnings, 0 informations
attrs (https://github.com/python-attrs/attrs)
- /tmp/mypy_primer/projects/attrs/tests/test_dunders.py:906:47 - error: No overloads for "instance_of" match the provided arguments (reportCallIssue)
- /tmp/mypy_primer/projects/attrs/tests/test_dunders.py:906:59 - error: Argument of type "type[int]" cannot be assigned to parameter "type" of type "tuple[type, ...]" in function "instance_of"
+ /tmp/mypy_primer/projects/attrs/tests/test_dunders.py:906:47 - error: Argument of type "_ValidatorType[int]" cannot be assigned to parameter "validator" of type "_ValidatorArgType[_T@attrib] | None" in function "attrib"
- "type[type]" is incompatible with "type[tuple[type, ...]]" (reportArgumentType)
+ Type "_ValidatorType[int]" is incompatible with type "_ValidatorType[str] | Sequence[_ValidatorType[str]] | None"
+ Type "_ValidatorType[int]" is incompatible with type "_ValidatorType[str]"
+ Parameter 2: type "Attribute[str]" is incompatible with type "Attribute[int]"
+ "Attribute[str]" is incompatible with "Attribute[int]"
+ Type parameter "_T@Attribute" is invariant, but "str" is not the same as "int"
+ Parameter 3: type "str" is incompatible with type "int"
+ "str" is incompatible with "int"
+ "function" is incompatible with "Sequence[_ValidatorType[str]]"
+ ... (reportArgumentType)
- /tmp/mypy_primer/projects/attrs/tests/test_validators.py:297:42 - error: Argument of type "_ValidatorType[str]" cannot be assigned to parameter "validator" of type "_ValidatorArgType[_T@attrib] | None" in function "attrib"
+ /tmp/mypy_primer/projects/attrs/tests/test_validators.py:297:42 - error: Argument of type "_ValidatorType[int]" cannot be assigned to parameter "validator" of type "_ValidatorArgType[_T@attrib] | None" in function "attrib"
- Type "_ValidatorType[str]" is incompatible with type "_ValidatorArgType[_T@attrib] | None"
+ Type "_ValidatorType[int]" is incompatible with type "_ValidatorType[str] | Sequence[_ValidatorType[str]] | None"
- Type "_ValidatorType[str]" is incompatible with type "_ValidatorType[_T@attrib]"
+ Type "_ValidatorType[int]" is incompatible with type "_ValidatorType[str]"
- Parameter 2: type "Attribute[_T@attrib]" is incompatible with type "Attribute[str]"
+ Parameter 2: type "Attribute[str]" is incompatible with type "Attribute[int]"
- "Attribute[Literal['a1']]" is incompatible with "Attribute[str]"
+ "Attribute[str]" is incompatible with "Attribute[int]"
- Type parameter "_T@Attribute" is invariant, but "Literal['a1']" is not the same as "str"
+ Type parameter "_T@Attribute" is invariant, but "str" is not the same as "int"
+ Parameter 3: type "str" is incompatible with type "int"
+ "str" is incompatible with "int"
- "function" is incompatible with "Sequence[_ValidatorType[_T@attrib]]"
+ "function" is incompatible with "Sequence[_ValidatorType[str]]"
+ ... (reportArgumentType)
- "function" is incompatible with "None" (reportArgumentType)
- /tmp/mypy_primer/projects/attrs/tests/test_validators.py:297:47 - error: No overloads for "instance_of" match the provided arguments (reportCallIssue)
- /tmp/mypy_primer/projects/attrs/tests/test_validators.py:297:59 - error: Argument of type "type[int]" cannot be assigned to parameter "type" of type "tuple[type, ...]" in function "instance_of"
- "type[type]" is incompatible with "type[tuple[type, ...]]" (reportArgumentType)
- 941 errors, 44 warnings, 5 informations
+ 938 errors, 44 warnings, 5 informations
paroxython (https://github.com/laowantong/paroxython)
+ /tmp/mypy_primer/projects/paroxython/paroxython/derived_labels_db.py:221:37 - error: Argument of type "type[str]" cannot be assigned to parameter "func" of type "(_T1@__new__) -> _S@map" in function "__new__"
+ No overloaded function matches type "(Any) -> LiteralString" (reportArgumentType)
- /tmp/mypy_primer/projects/paroxython/paroxython/derived_labels_db.py:221:28 - error: Argument of type "Generator[list[str], None, None]" cannot be assigned to parameter "iterable" of type "Iterable[SupportsRichComparisonT@sorted]" in function "sorted"
- "Generator[list[str], None, None]" is incompatible with "Iterable[list[LiteralString]]"
- Type parameter "_T_co@Iterable" is covariant, but "list[str]" is not a subtype of "list[LiteralString]"
- "list[str]" is incompatible with "list[LiteralString]"
- Type parameter "_T@list" is invariant, but "str" is not the same as "LiteralString"
- Consider switching from "list" to "Sequence" which is covariant (reportArgumentType)
pip (https://github.com/pypa/pip)
- /tmp/mypy_primer/projects/pip/src/pip/_internal/network/auth.py:329:16 - error: Expression of type "Literal[b""]" is incompatible with return type "str | None"
- Type "Literal[b""]" is incompatible with type "str | None"
- "Literal[b""]" is incompatible with "str"
- "Literal[b""]" is incompatible with "None" (reportReturnType)
- 1864 errors, 46 warnings, 0 informations
+ 1863 errors, 46 warnings, 0 informations
core (https://github.com/home-assistant/core)
- /tmp/mypy_primer/projects/core/homeassistant/bootstrap.py:437:27 - error: Argument of type "Coroutine[Any, Any, dict[str, Any]]" cannot be assigned to parameter "coro" of type "Coroutine[Any, Any, _T(11)@create_eager_task]" in function "create_eager_task"
- "Coroutine[Any, Any, dict[str, Any]]" is incompatible with "Coroutine[Any, Any, None]"
- Type parameter "_ReturnT_co_nd@Coroutine" is covariant, but "dict[str, Any]" is not a subtype of "None"
- "dict[str, Any]" is incompatible with "None" (reportArgumentType)
- /tmp/mypy_primer/projects/core/homeassistant/components/airthings_ble/__init__.py:59:54 - error: Expression of type "DataUpdateCoordinator[Module("airthings_ble")]" is incompatible with declared type "AirthingsBLEDataUpdateCoordinator"
- "homeassistant.helpers.update_coordinator.DataUpdateCoordinator" is incompatible with "homeassistant.helpers.update_coordinator.DataUpdateCoordinator"
- Type parameter "_DataT@DataUpdateCoordinator" is invariant, but "Module("airthings_ble")" is not the same as "Module("airthings_ble")" (reportAssignmentType)
+ /tmp/mypy_primer/projects/core/homeassistant/components/system_bridge/__init__.py:308:16 - error: Expression of type "dict[str, int | list[dict[str, Any]]]" is incompatible with return type "ServiceResponse"
+ Type "dict[str, int | list[dict[str, Any]]]" is incompatible with type "ServiceResponse"
+ "dict[str, int | list[dict[str, Any]]]" is incompatible with "dict[str, JsonValueType]"
+ Type parameter "_VT@dict" is invariant, but "int | list[dict[str, Any]]" is not the same as "JsonValueType"
+ Consider switching from "dict" to "Mapping" which is covariant in the value type
+ "dict[str, int | list[dict[str, Any]]]" is incompatible with "None" (reportReturnType)
- 24943 errors, 359 warnings, 0 informations
+ 24942 errors, 359 warnings, 0 informations
cki-lib (https://gitlab.com/cki-project/cki-lib)
- /tmp/mypy_primer/projects/cki-lib/cki_lib/stomp.py:75:44 - error: Object of type "None" cannot be used as iterable value (reportOptionalIterable)
- 198 errors, 23 warnings, 0 informations
+ 197 errors, 23 warnings, 0 informations
steam.py (https://github.com/Gobot1234/steam.py)
+ /tmp/mypy_primer/projects/steam.py/steam/clan.py:177:20 - error: Expression of type "Event[EventType, Clan | Self@PartialClan]" is incompatible with return type "Event[EventType, Self@PartialClan]"
+ "Event[EventType, Clan | Self@PartialClan]" is incompatible with "Event[EventType, Self@PartialClan]"
+ Type parameter "ClanT@Event" is covariant, but "Clan | Self@PartialClan" is not a subtype of "Self@PartialClan"
+ Type "Clan | Self@PartialClan" is incompatible with type "Self@PartialClan" (reportReturnType)
+ /tmp/mypy_primer/projects/steam.py/steam/clan.py:190:16 - error: Expression of type "Announcement[Clan | Self@PartialClan]" is incompatible with return type "Announcement[Self@PartialClan]"
+ "Announcement[Clan | Self@PartialClan]" is incompatible with "Announcement[Self@PartialClan]"
+ Type parameter "ClanT@Announcement" is covariant, but "Clan | Self@PartialClan" is not a subtype of "Self@PartialClan"
+ Type "Clan | Self@PartialClan" is incompatible with type "Self@PartialClan" (reportReturnType)
+ /tmp/mypy_primer/projects/steam.py/steam/id.py:462:16 - error: Expression of type "ID[Type]" is incompatible with return type "IndividualID | None"
+ Type "ID[Type]" is incompatible with type "IndividualID | None"
+ "ID[Type]" is incompatible with "ID[Literal[Type.Individual]]"
+ Type parameter "TypeT@ID" is covariant, but "Type" is not a subtype of "Literal[Type.Individual]"
+ "Type" is incompatible with type "Literal[Type.Individual]"
+ "ID[Type]" is incompatible with "None" (reportReturnType)
+ /tmp/mypy_primer/projects/steam.py/steam/id.py:513:20 - error: Expression of type "ID[Type]" is incompatible with return type "ID[Literal[Type.Individual]] | None"
+ Type "ID[Type]" is incompatible with type "ID[Literal[Type.Individual]] | None"
+ "ID[Type]" is incompatible with "ID[Literal[Type.Individual]]"
+ Type parameter "TypeT@ID" is covariant, but "Type" is not a subtype of "Literal[Type.Individual]"
+ "Type" is incompatible with type "Literal[Type.Individual]"
+ "ID[Type]" is incompatible with "None" (reportReturnType)
+ /tmp/mypy_primer/projects/steam.py/steam/utils.py:151:25 - error: Argument of type "ID[Type]" cannot be assigned to parameter "id" of type "IndividualID" in function "__init__"
+ "ID[Type]" is incompatible with "ID[Literal[Type.Individual]]"
+ Type parameter "TypeT@ID" is covariant, but "Type" is not a subtype of "Literal[Type.Individual]"
+ "Type" is incompatible with type "Literal[Type.Individual]" (reportArgumentType)
- 8465 errors, 90 warnings, 0 informations
+ 8470 errors, 90 warnings, 0 informations
pytest (https://github.com/pytest-dev/pytest)
+ /tmp/mypy_primer/projects/pytest/src/_pytest/python.py:245:24 - error: Expression of type "list[Function]" is incompatible with return type "Item | Collector | list[Item | Collector] | None"
+ Type "list[Function]" is incompatible with type "Item | Collector | list[Item | Collector] | None"
+ "list[Function]" is incompatible with "None"
+ "list[Function]" is incompatible with "Item"
+ "list[Function]" is incompatible with "Collector"
+ "list[Function]" is incompatible with "list[Item | Collector]"
+ Type parameter "_T@list" is invariant, but "Function" is not the same as "Item | Collector"
+ Consider switching from "list" to "Sequence" which is covariant (reportReturnType)
- 789 errors, 40 warnings, 0 informations
+ 790 errors, 40 warnings, 0 informations
xarray (https://github.com/pydata/xarray)
- /tmp/mypy_primer/projects/xarray/xarray/backends/common.py:114:17 - error: Expression of type "list[Unknown | str | Sequence[str | PathLike[Unknown]] | Sequence[Sequence[str | PathLike[Unknown]]] | Sequence[Sequence[Sequence[str | PathLike[Unknown]]]]]" is incompatible with declared type "NestedSequence[str | PathLike[Unknown]]" (reportAssignmentType)
+ /tmp/mypy_primer/projects/xarray/xarray/backends/common.py:114:17 - error: Expression of type "list[str | Sequence[str | PathLike[Unknown]] | Sequence[Sequence[str | PathLike[Unknown]]] | Sequence[Sequence[Sequence[str | PathLike[Unknown]]]]]" is incompatible with declared type "NestedSequence[str | PathLike[Unknown]]" (reportAssignmentType)
- /tmp/mypy_primer/projects/xarray/xarray/backends/common.py:116:12 - error: Expression of type "NestedSequence[str | PathLike[Unknown]] | list[str | PathLike[Unknown]]" is incompatible with return type "list[str]"
+ /tmp/mypy_primer/projects/xarray/xarray/backends/common.py:116:12 - error: Expression of type "NestedSequence[str | PathLike[Unknown]] | list[str | PathLike[Unknown]] | list[str]" is incompatible with return type "list[str]"
- Type "NestedSequence[str | PathLike[Unknown]] | list[str | PathLike[Unknown]]" is incompatible with type "list[str]"
+ Type "NestedSequence[str | PathLike[Unknown]] | list[str | PathLike[Unknown]] | list[str]" is incompatible with type "list[str]"
+ /tmp/mypy_primer/projects/xarray/xarray/core/groupby.py:428:36 - error: Argument of type "T_DataWithCoords@_resolve_group" cannot be assigned to parameter "obj" of type "T_Xarray@_DummyGroup" in function "__init__"
+ Type "T_DataWithCoords@_resolve_group" is incompatible with constrained type variable "T_Xarray" (reportArgumentType)
- 2555 errors, 108 warnings, 0 informations
+ 2556 errors, 108 warnings, 0 informations
antidote (https://github.com/Finistere/antidote)
- /tmp/mypy_primer/projects/antidote/src/antidote/core/_inject.py:293:24 - error: Return type, "staticmethod[..., Unknown]", is partially unknown (reportUnknownVariableType)
- /tmp/mypy_primer/projects/antidote/src/antidote/core/_inject.py:295:24 - error: Return type, "classmethod[Any, ..., Unknown]", is partially unknown (reportUnknownVariableType)
- 743 errors, 77 warnings, 0 informations
+ 741 errors, 77 warnings, 0 informations
mongo-python-driver (https://github.com/mongodb/mongo-python-driver)
+ /tmp/mypy_primer/projects/mongo-python-driver/bson/json_util.py:550:18 - error: Argument of type "str | bytes" cannot be assigned to parameter "pattern" of type "_T@Regex" in function "__init__"
+ Type "str | bytes" is incompatible with constrained type variable "_T" (reportArgumentType)
+ /tmp/mypy_primer/projects/mongo-python-driver/test/test_typing.py:430:17 - error: Argument of type "list[InsertOne[dict[str, ObjectId | str | int]]]" cannot be assigned to parameter "requests" of type "Sequence[InsertOne[MovieWithId] | DeleteOne | DeleteMany | ReplaceOne[MovieWithId] | UpdateOne | UpdateMany]" in function "bulk_write"
+ Type "InsertOne[dict[str, ObjectId | str | int]]" is incompatible with type "InsertOne[MovieWithId] | DeleteOne | DeleteMany | ReplaceOne[MovieWithId] | UpdateOne | UpdateMany"
+ "InsertOne[dict[str, ObjectId | str | int]]" is incompatible with "InsertOne[MovieWithId]"
+ Type parameter "_DocumentType@InsertOne" is invariant, but "dict[str, ObjectId | str | int]" is not the same as "MovieWithId"
+ "InsertOne[dict[str, ObjectId | str | int]]" is incompatible with "DeleteOne"
+ "InsertOne[dict[str, ObjectId | str | int]]" is incompatible with "DeleteMany"
+ "InsertOne[dict[str, ObjectId | str | int]]" is incompatible with "ReplaceOne[MovieWithId]"
+ "InsertOne[dict[str, ObjectId | str | int]]" is incompatible with "UpdateOne"
+ "InsertOne[dict[str, ObjectId | str | int]]" is incompatible with "UpdateMany" (reportArgumentType)
+ /tmp/mypy_primer/projects/mongo-python-driver/test/test_typing.py:447:17 - error: Argument of type "list[ReplaceOne[dict[str, ObjectId | str | int]]]" cannot be assigned to parameter "requests" of type "Sequence[InsertOne[MovieWithId] | DeleteOne | DeleteMany | ReplaceOne[MovieWithId] | UpdateOne | UpdateMany]" in function "bulk_write"
+ Type "ReplaceOne[dict[str, ObjectId | str | int]]" is incompatible with type "InsertOne[MovieWithId] | DeleteOne | DeleteMany | ReplaceOne[MovieWithId] | UpdateOne | UpdateMany"
+ "ReplaceOne[dict[str, ObjectId | str | int]]" is incompatible with "InsertOne[MovieWithId]"
+ "ReplaceOne[dict[str, ObjectId | str | int]]" is incompatible with "DeleteOne"
+ "ReplaceOne[dict[str, ObjectId | str | int]]" is incompatible with "DeleteMany"
+ "ReplaceOne[dict[str, ObjectId | str | int]]" is incompatible with "ReplaceOne[MovieWithId]"
+ Type parameter "_DocumentType@ReplaceOne" is invariant, but "dict[str, ObjectId | str | int]" is not the same as "MovieWithId"
+ "ReplaceOne[dict[str, ObjectId | str | int]]" is incompatible with "UpdateOne"
+ "ReplaceOne[dict[str, ObjectId | str | int]]" is incompatible with "UpdateMany" (reportArgumentType)
- 710 errors, 24 warnings, 0 informations
+ 713 errors, 24 warnings, 0 informations
bokeh (https://github.com/bokeh/bokeh)
+ /tmp/mypy_primer/projects/bokeh/examples/reference/models/dropdown_menu_server.py:28:22 - error: "x" is possibly unbound (reportPossiblyUnboundVariable)
+ /tmp/mypy_primer/projects/bokeh/examples/reference/models/dropdown_menu_server.py:28:27 - error: "y" is possibly unbound (reportPossiblyUnboundVariable)
+ /tmp/mypy_primer/projects/bokeh/examples/reference/models/dropdown_menu_server.py:28:31 - error: "color" is possibly unbound (reportPossiblyUnboundVariable)
- /tmp/mypy_primer/projects/bokeh/src/bokeh/layouts.py:311:45 - error: Argument of type "dict[str, type[Plot]]" cannot be assigned to parameter "selector" of type "SelectorType" in function "select"
... (truncated 365 lines) ...```
Diff from mypy_primer, showing the effect of this PR on open source code: