Fixed regression introduced in 1.1.343 that results in nondeterminist…#10865
Merged
Fixed regression introduced in 1.1.343 that results in nondeterminist…#10865
Conversation
…ic (order-dependent) type evaluation under certain circumstances involving recursive type aliases. This addresses #10850.
Contributor
|
Diff from mypy_primer, showing the effect of this PR on open source code: Tanjun (https://github.com/FasterSpeeding/Tanjun)
+ .../projects/Tanjun/tanjun/_internal/__init__.py:699:21 - warning: Type of "node" is partially unknown
+ Type of "node" is "dict[str | _IndexKeys, _TreeT | list[tuple[list[str], MessageCommand[Any]]]] | list[tuple[list[str], MessageCommand[Any]]] | Unknown" (reportUnknownVariableType)
+ .../projects/Tanjun/tanjun/_internal/__init__.py:707:34 - warning: Argument type is partially unknown
+ Argument corresponds to parameter "object" in function "append"
+ Argument type is "tuple[str, dict[str | _IndexKeys, dict[str | _IndexKeys, ...] | list[tuple[list[str], MessageCommand[Any]]]] | dict[Unknown, Unknown]]" (reportUnknownArgumentType)
+ .../projects/Tanjun/tanjun/_internal/__init__.py:712:17 - warning: Type of "entries" is partially unknown
+ Type of "entries" is "dict[str | _IndexKeys, _TreeT | list[tuple[list[str], MessageCommand[Any]]]] | list[tuple[list[str], MessageCommand[Any]]] | Unknown" (reportUnknownVariableType)
+ .../projects/Tanjun/tanjun/_internal/__init__.py:714:17 - warning: Type of "remove" is partially unknown
+ Type of "remove" is "((value: tuple[list[str], MessageCommand[Any]], /) -> None) | ((value: Unknown, /) -> None)" (reportUnknownMemberType)
- 36 errors, 108 warnings, 0 informations
+ 36 errors, 112 warnings, 0 informations
ibis (https://github.com/ibis-project/ibis)
- .../projects/ibis/ibis/backends/polars/rewrites.py:114:25 - error: Argument of type "list[Unknown]" cannot be assigned to parameter "left_on" of type "VarTuple[Value[Unknown, Any]]" in function "__init__"
- "list[Unknown]" is not assignable to "tuple[Value[Unknown, Any], ...]" (reportArgumentType)
- .../projects/ibis/ibis/backends/polars/rewrites.py:115:26 - error: Argument of type "list[Unknown]" cannot be assigned to parameter "right_on" of type "VarTuple[Value[Unknown, Any]]" in function "__init__"
- "list[Unknown]" is not assignable to "tuple[Value[Unknown, Any], ...]" (reportArgumentType)
- .../projects/ibis/ibis/backends/polars/rewrites.py:116:25 - error: Argument of type "list[Unknown]" cannot be assigned to parameter "left_by" of type "VarTuple[Value[Unknown, Any]]" in function "__init__"
- "list[Unknown]" is not assignable to "tuple[Value[Unknown, Any], ...]" (reportArgumentType)
- .../projects/ibis/ibis/backends/polars/rewrites.py:117:26 - error: Argument of type "list[Unknown]" cannot be assigned to parameter "right_by" of type "VarTuple[Value[Unknown, Any]]" in function "__init__"
- "list[Unknown]" is not assignable to "tuple[Value[Unknown, Any], ...]" (reportArgumentType)
- .../projects/ibis/ibis/backends/polars/rewrites.py:127:25 - error: Argument of type "list[Unknown]" cannot be assigned to parameter "left_on" of type "VarTuple[Value[Unknown, Any]]" in function "__init__"
- "list[Unknown]" is not assignable to "tuple[Value[Unknown, Any], ...]" (reportArgumentType)
- .../projects/ibis/ibis/backends/polars/rewrites.py:128:26 - error: Argument of type "list[Unknown]" cannot be assigned to parameter "right_on" of type "VarTuple[Value[Unknown, Any]]" in function "__init__"
- "list[Unknown]" is not assignable to "tuple[Value[Unknown, Any], ...]" (reportArgumentType)
- 7360 errors, 238 warnings, 0 informations
+ 7354 errors, 238 warnings, 0 informations
sympy (https://github.com/sympy/sympy)
- .../projects/sympy/sympy/codegen/ast.py:872:7 - error: Base classes for class "String" define method "sort_key" in incompatible way
- Return type mismatch: base method returns type "tuple[tuple[int, int, str], tuple[int, tuple[tuple[tuple[int, int, str], Unknown, tuple[tuple[Literal[1], Literal[0], Literal['Number']], tuple[int, tuple[()]], tuple[()], One], One], ...]], tuple[tuple[Literal[1], Literal[0], Literal['Number']], tuple[int, tuple[()]], tuple[()], One], One]", override returns type "tuple[tuple[Literal[2], Literal[0], str], tuple[int, tuple[str]], tuple[tuple[Literal[1], Literal[0], Literal['Number']], tuple[int, tuple[()]], tuple[()], One], One]"
- "tuple[tuple[Literal[2], Literal[0], str], tuple[int, tuple[str]], tuple[tuple[Literal[1], Literal[0], Literal['Number']], tuple[int, tuple[()]], tuple[()], One], One]" is not assignable to "tuple[tuple[int, int, str], tuple[int, tuple[tuple[tuple[int, int, str], Unknown, tuple[tuple[Literal[1], Literal[0], Literal['Number']], tuple[int, tuple[()]], tuple[()], One], One], ...]], tuple[tuple[Literal[1], Literal[0], Literal['Number']], tuple[int, tuple[()]], tuple[()], One], One]"
- Tuple entry 2 is incorrect type
- "tuple[int, tuple[str]]" is not assignable to "tuple[int, tuple[tuple[tuple[int, int, str], Unknown, tuple[tuple[Literal[1], Literal[0], Literal['Number']], tuple[int, tuple[()]], tuple[()], One], One], ...]]"
- Tuple entry 2 is incorrect type (reportIncompatibleMethodOverride)
- .../projects/sympy/sympy/combinatorics/fp_groups.py:243:31 - error: Argument of type "Unknown | GaussianRational | MPQ | GaussianInteger | MPZ | Expr | Rational | NaN | ComplexInfinity | One | NegativeOne | Zero | Integer | Infinity | NegativeInfinity | Float | Number | Poly | Any" cannot be assigned to parameter "x" of type "SupportsAbs[_T@abs]" in function "abs"
- Type "Unknown | GaussianRational | MPQ | GaussianInteger | MPZ | Expr | Rational | NaN | ComplexInfinity | One | NegativeOne | Zero | Integer | Infinity | NegativeInfinity | Float | Number | Poly | Any" is not assignable to type "SupportsAbs[Expr]"
- "GaussianInteger" is incompatible with protocol "SupportsAbs[Expr]"
- "__abs__" is not present (reportArgumentType)
- Return type mismatch: base method returns type "tuple[tuple[int, int, str], tuple[int, tuple[tuple[tuple[int, int, str], Unknown, tuple[tuple[Literal[1], Literal[0], Literal['Number']], tuple[int, tuple[()]], tuple[()], One], One], ...]], tuple[tuple[Literal[1], Literal[0], Literal['Number']], tuple[int, tuple[()]], tuple[()], One], One]", override returns type "tuple[tuple[tuple[int, int, str], tuple[int, tuple[tuple[tuple[int, int, str], Unknown, tuple[tuple[Literal[1], Literal[0], Literal['Number']], tuple[int, tuple[()]], tuple[()], One], One] | Unknown, ...]], tuple[tuple[Literal[1], Literal[0], Literal['Number']], tuple[int, tuple[()]], tuple[()], One], One] | Unknown | tuple[tuple[int, int, str | Unknown], Unknown | tuple[int, tuple[str]], tuple[tuple[Literal[1], Literal[0], Literal['Number']], tuple[int, tuple[()]], tuple[()], One], One], ...]"
- "tuple[tuple[tuple[int, int, str], tuple[int, tuple[tuple[tuple[int, int, str], Unknown, tuple[tuple[Literal[1], Literal[0], Literal['Number']], tuple[int, tuple[()]], tuple[()], One], One] | Unknown, ...]], tuple[tuple[Literal[1], Literal[0], Literal['Number']], tuple[int, tuple[()]], tuple[()], One], One] | Unknown | tuple[tuple[int, int, str | Unknown], Unknown | tuple[int, tuple[str]], tuple[tuple[Literal[1], Literal[0], Literal['Number']], tuple[int, tuple[()]], tuple[()], One], One], ...]" is not assignable to "tuple[tuple[int, int, str], tuple[int, tuple[tuple[tuple[int, int, str], Unknown, tuple[tuple[Literal[1], Literal[0], Literal['Number']], tuple[int, tuple[()]], tuple[()], One], One], ...]], tuple[tuple[Literal[1], Literal[0], Literal['Number']], tuple[int, tuple[()]], tuple[()], One], One]"
+ Return type mismatch: base method returns type "tuple[tuple[int, int, str], tuple[int, tuple[Unknown, ...]], tuple[tuple[Literal[1], Literal[0], Literal['Number']], tuple[int, tuple[()]], tuple[()], One], One]", override returns type "tuple[tuple[tuple[int, int, str], tuple[int, tuple[Unknown, ...]], tuple[tuple[Literal[1], Literal[0], Literal['Number']], tuple[int, tuple[()]], tuple[()], One], One] | Unknown | tuple[tuple[int, int, str | Unknown], tuple[int, tuple[Unknown, ...]] | tuple[int, tuple[str]], tuple[tuple[Literal[1], Literal[0], Literal['Number']], tuple[int, tuple[()]], tuple[()], One], One], ...]"
+ "tuple[tuple[tuple[int, int, str], tuple[int, tuple[Unknown, ...]], tuple[tuple[Literal[1], Literal[0], Literal['Number']], tuple[int, tuple[()]], tuple[()], One], One] | Unknown | tuple[tuple[int, int, str | Unknown], tuple[int, tuple[Unknown, ...]] | tuple[int, tuple[str]], tuple[tuple[Literal[1], Literal[0], Literal['Number']], tuple[int, tuple[()]], tuple[()], One], One], ...]" is not assignable to "tuple[tuple[int, int, str], tuple[int, tuple[Unknown, ...]], tuple[tuple[Literal[1], Literal[0], Literal['Number']], tuple[int, tuple[()]], tuple[()], One], One]"
- .../projects/sympy/sympy/combinatorics/perm_groups.py:2796:32 - error: Operator "^" not supported for types "Basic" and "Basic" (reportOperatorIssue)
+ .../projects/sympy/sympy/combinatorics/perm_groups.py:4565:19 - error: "_p_elements_group" is not a known attribute of "None" (reportOptionalMemberAccess)
+ .../projects/sympy/sympy/combinatorics/tensor_can.py:836:16 - error: Operator "-" not supported for "None" (reportOptionalOperand)
+ .../projects/sympy/sympy/combinatorics/tensor_can.py:844:49 - error: Object of type "None" cannot be used as iterable value (reportOptionalIterable)
+ .../projects/sympy/sympy/combinatorics/tensor_can.py:844:51 - error: Cannot access attribute "_array_form" for class "list[int]"
+ Attribute "_array_form" is unknown (reportAttributeAccessIssue)
+ .../projects/sympy/sympy/combinatorics/tensor_can.py:844:51 - error: Cannot access attribute "_array_form" for class "Basic"
+ Attribute "_array_form" is unknown (reportAttributeAccessIssue)
- .../projects/sympy/sympy/combinatorics/tests/test_group_numbers.py:11:32 - error: Operator "**" not supported for types "int | array[int] | None" and "Literal[12]"
- Operator "**" not supported for types "None" and "Literal[12]"
- Operator "**" not supported for types "array[int]" and "Literal[12]" (reportOperatorIssue)
+ .../projects/sympy/sympy/combinatorics/testutil.py:248:37 - error: Operator "-" not supported for "None" (reportOptionalOperand)
+ .../projects/sympy/sympy/combinatorics/testutil.py:257:52 - error: Operator "-" not supported for "None" (reportOptionalOperand)
+ .../projects/sympy/sympy/combinatorics/testutil.py:270:12 - error: Operator "*" not supported for types "tuple[Literal[0]]" and "Unknown | None"
+ Operator "*" not supported for types "tuple[Literal[0]]" and "None" (reportOperatorIssue)
- Return type mismatch: base method returns type "Basic", override returns type "tuple[Unknown, ...] | Unknown | Product* | Basic | BooleanFalse | BooleanTrue | Equality | Expr | Self@Product | ComplexInfinity | Float | Infinity | Integer | NaN | NegativeInfinity | NegativeOne | Number | One | Rational | Zero"
- Type "tuple[Unknown, ...] | Unknown | Product* | Basic | BooleanFalse | BooleanTrue | Equality | Expr | ComplexInfinity | Float | Infinity | Integer | NaN | NegativeInfinity | NegativeOne | Number | One | Rational | Zero" is not assignable to type "Basic"
+ Return type mismatch: base method returns type "Basic", override returns type "tuple[Unknown, ...] | Unknown | Product | Basic | Expr | One"
+ Type "tuple[Unknown, ...] | Unknown | Product | Basic | Expr | One" is not assignable to type "Basic"
+ .../projects/sympy/sympy/concrete/products.py:275:21 - error: Operator "/" not supported for types "Literal[1]" and "Basic | One | Unknown | Expr | Product*"
- .../projects/sympy/sympy/concrete/products.py:275:21 - error: Operator "/" not supported for types "Literal[1]" and "Basic | One | Unknown | tuple[Unknown, ...] | Product* | Equality | BooleanFalse | BooleanTrue | NaN | Zero | NegativeOne | Integer | ComplexInfinity | Rational | Infinity | NegativeInfinity | Float | Number | Expr"
- Operator "/" not supported for types "Literal[1]" and "Basic"
- Operator "/" not supported for types "Literal[1]" and "tuple[Unknown, ...]"
- Operator "/" not supported for types "Literal[1]" and "Equality" (reportOperatorIssue)
+ Operator "/" not supported for types "Literal[1]" and "Basic" (reportOperatorIssue)
- .../projects/sympy/sympy/concrete/products.py:284:22 - error: Cannot access attribute "doit" for class "tuple[Unknown, ...]"
- Attribute "doit" is unknown (reportAttributeAccessIssue)
- .../projects/sympy/sympy/concrete/tests/test_products.py:68:12 - error: Operator "*" not supported for types "tuple[Unknown, ...] | Unknown | Product | Basic | BooleanFalse | BooleanTrue | ComplexInfinity | Equality | Expr | Float | Infinity | Integer | NaN | NegativeInfinity | NegativeOne | Number | One | Rational | Zero" and "tuple[Unknown, ...] | Unknown | Product | Basic | BooleanFalse | BooleanTrue | ComplexInfinity | Equality | Expr | Float | Infinity | Integer | NaN | NegativeInfinity | NegativeOne | Number | One | Rational | Zero"
+ .../projects/sympy/sympy/concrete/tests/test_products.py:68:12 - error: Operator "*" not supported for types "tuple[Unknown, ...] | Unknown | Product | Basic | Expr | One | BooleanFalse | BooleanTrue | Equality | NaN" and "tuple[Unknown, ...] | Unknown | Product | Basic | Expr | One | BooleanFalse | BooleanTrue | Equality | NaN"
- Operator "*" not supported for types "tuple[Unknown, ...]" and "ComplexInfinity"
- Operator "*" not supported for types "tuple[Unknown, ...]" and "Float"
... (truncated 3620 lines) ...
kornia (https://github.com/kornia/kornia)
- .../projects/kornia/kornia/feature/scale_space_detector.py:187:105 - error: Type of "coord_max" could not be determined because it refers to itself (reportGeneralTypeIssues)
- .../projects/kornia/kornia/feature/scale_space_detector.py:191:34 - error: Type of "coord_max" could not be determined because it refers to itself (reportGeneralTypeIssues)
- 5897 errors, 10 warnings, 0 informations
+ 5895 errors, 10 warnings, 0 informations
openlibrary (https://github.com/internetarchive/openlibrary)
+ .../projects/openlibrary/openlibrary/plugins/openlibrary/stats.py:150:24 - error: "__name__" is not a known attribute of "None" (reportOptionalMemberAccess)
+ .../projects/openlibrary/openlibrary/plugins/openlibrary/stats.py:151:73 - error: "encoding" is not a known attribute of "None" (reportOptionalMemberAccess)
+ .../projects/openlibrary/openlibrary/plugins/openlibrary/stats.py:152:35 - error: "encoding" is not a known attribute of "None" (reportOptionalMemberAccess)
+ .../projects/openlibrary/openlibrary/plugins/worksearch/subjects.py:324:20 - error: Cannot assign to attribute "facet_counts" for class "SearchResponse"
+ Expression of type "dict[str, list[list[int] | Unknown | list[Unknown]]]" cannot be assigned to attribute "facet_counts" of class "SearchResponse"
+ "dict[str, list[list[int] | Unknown | list[Unknown]]]" is not assignable to "dict[str, tuple[str, str, int]]"
+ Type parameter "_VT@dict" is invariant, but "list[list[int] | Unknown | list[Unknown]]" is not the same as "tuple[str, str, int]"
+ Consider switching from "dict" to "Mapping" which is covariant in the value type (reportAttributeAccessIssue)
+ .../projects/openlibrary/openlibrary/plugins/worksearch/subjects.py:326:65 - error: Argument of type "str | Unknown" cannot be assigned to parameter "count" of type "int" in function "facet_wrapper"
+ Type "str | Unknown" is not assignable to type "int"
+ "str" is not assignable to "int" (reportArgumentType)
+ .../projects/openlibrary/openlibrary/plugins/worksearch/subjects.py:327:46 - error: "int" is not iterable
+ "__iter__" method not defined (reportGeneralTypeIssues)
+ .../projects/openlibrary/openlibrary/plugins/worksearch/subjects.py:335:39 - error: "int" is not iterable
+ "__iter__" method not defined (reportGeneralTypeIssues)
+ .../projects/openlibrary/openlibrary/plugins/worksearch/subjects.py:355:36 - error: "int" is not iterable
+ "__iter__" method not defined (reportGeneralTypeIssues)
+ .../projects/openlibrary/openlibrary/plugins/worksearch/subjects.py:356:20 - error: Operator "<" not supported for types "Literal[1000]" and "str | Unknown"
+ Operator "<" not supported for types "Literal[1000]" and "str" (reportOperatorIssue)
+ .../projects/openlibrary/openlibrary/plugins/worksearch/subjects.py:356:27 - error: Operator "<=" not supported for types "str | Unknown" and "int"
+ Operator "<=" not supported for types "str" and "int" (reportOperatorIssue)
- 1243 errors, 66 warnings, 0 informations
+ 1253 errors, 66 warnings, 0 informations
werkzeug (https://github.com/pallets/werkzeug)
- .../projects/werkzeug/src/werkzeug/formparser.py:399:61 - error: "container" is possibly unbound (reportPossiblyUnboundVariable)
+ .../projects/werkzeug/src/werkzeug/formparser.py:399:61 - error: "container" is unbound (reportUnboundVariable)
- "Rv" is incompatible with protocol "Iterable[bytes]"
+ "Rv" is incompatible with protocol "Iterable[bytes]" (reportArgumentType)
- "__iter__" is an incompatible type (reportArgumentType)
trio (https://github.com/python-trio/trio)
- .../projects/trio/src/trio/_tests/test_exports.py:403:46 - error: Argument type is partially unknown
- Argument corresponds to parameter "args" in function "__call__"
- Argument type is "Any | Unknown" (reportUnknownArgumentType)
- 1567 errors, 13 warnings, 0 informations
+ 1566 errors, 13 warnings, 0 informations
bokeh (https://github.com/bokeh/bokeh)
- .../projects/bokeh/src/bokeh/models/mappers.py:383:26 - error: Argument of type "Nullable[str] | Unknown" cannot be assigned to parameter "obj" of type "Sized" in function "len"
+ .../projects/bokeh/src/bokeh/models/mappers.py:383:26 - error: Argument of type "Nullable[str] | Unknown | list[Unknown]" cannot be assigned to parameter "obj" of type "Sized" in function "len"
- Type "Nullable[str] | Unknown" is not assignable to type "Sized"
+ Type "Nullable[str] | Unknown | list[Unknown]" is not assignable to type "Sized"
- .../projects/bokeh/src/bokeh/models/mappers.py:389:42 - error: Argument of type "Nullable[str] | Unknown" cannot be assigned to parameter "iterable" of type "Iterable[_T@list]" in function "__init__"
+ .../projects/bokeh/src/bokeh/models/mappers.py:389:42 - error: Argument of type "Nullable[str] | Unknown | list[Unknown]" cannot be assigned to parameter "iterable" of type "Iterable[_T@list]" in function "__init__"
- Type "Nullable[str] | Unknown" is not assignable to type "Iterable[_T@list]"
+ Type "Nullable[str] | Unknown | list[Unknown]" is not assignable to type "Iterable[_T@list]"
- .../projects/bokeh/src/bokeh/models/sources.py:594:33 - error: Cannot access attribute "values" for class "Sequence[Any]"
- Attribute "values" is unknown (reportAttributeAccessIssue)
- .../projects/bokeh/src/bokeh/models/sources.py:594:33 - error: Cannot access attribute "values" for class "NDArray[Any]"
- Attribute "values" is unknown (reportAttributeAccessIssue)
- 1056 errors, 51 warnings, 0 informations
+ 1054 errors, 51 warnings, 0 informations
scikit-learn (https://github.com/scikit-learn/scikit-learn)
- .../projects/scikit-learn/sklearn/cluster/_spectral.py:760:13 - error: Expression with type "tuple[Unknown | Any, Unknown | None, Unknown | None, Unknown] | tuple[Unknown | Any, Unknown | None, Unknown | None]" cannot be assigned to target tuple
+ .../projects/scikit-learn/sklearn/cluster/_spectral.py:760:13 - error: Expression with type "tuple[Unknown | Any, Unknown | None, Unknown | None, int] | tuple[Unknown | Any, Unknown | None, Unknown | None]" cannot be assigned to target tuple
- Type "tuple[Unknown | Any, Unknown | None, Unknown | None, Unknown]" is incompatible with target tuple
+ Type "tuple[Unknown | Any, Unknown | None, Unknown | None, int]" is incompatible with target tuple
- .../projects/scikit-learn/sklearn/cluster/tests/test_k_means.py:779:5 - error: Expression with type "tuple[Unknown | Any, Unknown | None, Unknown | None, Unknown] | tuple[Unknown | Any, Unknown | None, Unknown | None]" cannot be assigned to target tuple
+ .../projects/scikit-learn/sklearn/cluster/tests/test_k_means.py:779:5 - error: Expression with type "tuple[Unknown | Any, Unknown | None, Unknown | None, int] | tuple[Unknown | Any, Unknown | None, Unknown | None]" cannot be assigned to target tuple
- Type "tuple[Unknown | Any, Unknown | None, Unknown | None, Unknown]" is incompatible with target tuple
+ Type "tuple[Unknown | Any, Unknown | None, Unknown | None, int]" is incompatible with target tuple
+ .../projects/scikit-learn/sklearn/decomposition/_incremental_pca.py:354:21 - error: Operator "*" not supported for types "ndarray[_Shape, dtype[_Float]]" and "Any | None"
+ Operator "*" not supported for types "ndarray[_Shape, dtype[_Float]]" and "None" when expected type is "_ArrayLike[Unknown | Any]" (reportOperatorIssue)
- .../projects/scikit-learn/sklearn/decomposition/tests/test_incremental_pca.py:364:53 - error: Argument of type "Unknown | None" cannot be assigned to parameter "desired" of type "_NumericArrayLike" in function "assert_array_almost_equal"
+ .../projects/scikit-learn/sklearn/decomposition/tests/test_incremental_pca.py:364:53 - error: Argument of type "ndarray[_Shape, dtype[_Float]] | None" cannot be assigned to parameter "desired" of type "_NumericArrayLike" in function "assert_array_almost_equal"
- Type "Unknown | None" is not assignable to type "_NumericArrayLike"
+ Type "ndarray[_Shape, dtype[_Float]] | None" is not assignable to type "_NumericArrayLike"
- .../projects/scikit-learn/sklearn/decomposition/tests/test_incremental_pca.py:381:9 - error: Argument of type "Unknown | None" cannot be assigned to parameter "actual" of type "_NumericArrayLike" in function "assert_array_almost_equal"
+ .../projects/scikit-learn/sklearn/decomposition/tests/test_incremental_pca.py:381:9 - error: Argument of type "ndarray[_Shape, dtype[_Float]] | None" cannot be assigned to parameter "actual" of type "_NumericArrayLike" in function "assert_array_almost_equal"
- Type "Unknown | None" is not assignable to type "_NumericArrayLike"
+ Type "ndarray[_Shape, dtype[_Float]] | None" is not assignable to type "_NumericArrayLike"
- .../projects/scikit-learn/sklearn/decomposition/tests/test_incremental_pca.py:405:31 - error: Argument of type "Unknown | None" cannot be assigned to parameter "actual" of type "_NumericArrayLike" in function "assert_array_almost_equal"
+ .../projects/scikit-learn/sklearn/decomposition/tests/test_incremental_pca.py:405:31 - error: Argument of type "ndarray[_Shape, dtype[_Float]] | None" cannot be assigned to parameter "actual" of type "_NumericArrayLike" in function "assert_array_almost_equal"
- Type "Unknown | None" is not assignable to type "_NumericArrayLike"
+ Type "ndarray[_Shape, dtype[_Float]] | None" is not assignable to type "_NumericArrayLike"
- .../projects/scikit-learn/sklearn/decomposition/tests/test_incremental_pca.py:463:9 - error: Argument of type "Unknown | None" cannot be assigned to parameter "actual" of type "_NumericArrayLike" in function "assert_allclose"
+ .../projects/scikit-learn/sklearn/decomposition/tests/test_incremental_pca.py:463:9 - error: Argument of type "ndarray[_Shape, dtype[_Float]] | None" cannot be assigned to parameter "actual" of type "_NumericArrayLike" in function "assert_allclose"
- Type "Unknown | None" is not assignable to type "_NumericArrayLike"
+ Type "ndarray[_Shape, dtype[_Float]] | None" is not assignable to type "_NumericArrayLike"
- .../projects/scikit-learn/sklearn/decomposition/tests/test_incremental_pca.py:463:43 - error: Argument of type "Unknown | None" cannot be assigned to parameter "desired" of type "_NumericArrayLike" in function "assert_allclose"
+ .../projects/scikit-learn/sklearn/decomposition/tests/test_incremental_pca.py:463:43 - error: Argument of type "ndarray[_Shape, dtype[_Float]] | None" cannot be assigned to parameter "desired" of type "_NumericArrayLike" in function "assert_allclose"
- Type "Unknown | None" is not assignable to type "_NumericArrayLike"
+ Type "ndarray[_Shape, dtype[_Float]] | None" is not assignable to type "_NumericArrayLike"
- .../projects/scikit-learn/sklearn/decomposition/tests/test_incremental_pca.py:479:32 - error: Argument of type "Unknown | None" cannot be assigned to parameter "actual" of type "_NumericArrayLike" in function "assert_allclose"
+ .../projects/scikit-learn/sklearn/decomposition/tests/test_incremental_pca.py:479:32 - error: Argument of type "ndarray[_Shape, dtype[_Float]] | None" cannot be assigned to parameter "actual" of type "_NumericArrayLike" in function "assert_allclose"
- Type "Unknown | None" is not assignable to type "_NumericArrayLike"
+ Type "ndarray[_Shape, dtype[_Float]] | None" is not assignable to type "_NumericArrayLike"
- .../projects/scikit-learn/sklearn/feature_selection/_base.py:154:31 - error: Cannot access attribute "ravel" for class "csc_matrix[Any]"
- Attribute "ravel" is unknown (reportAttributeAccessIssue)
- .../projects/scikit-learn/sklearn/gaussian_process/_gpc.py:224:28 - error: Operator "-" not supported for type "Any | float | Unknown | tuple[float | Any | Unknown, NDArray[float64]]" (reportOperatorIssue)
+ .../projects/scikit-learn/sklearn/gaussian_process/_gpc.py:224:28 - error: Operator "-" not supported for type "Any | float | Unknown | tuple[float | Unknown | Any, NDArray[float64]]" (reportOperatorIssue)
- .../projects/scikit-learn/sklearn/gaussian_process/tests/test_gpc.py:70:12 - error: Operator ">" not supported for types "floating[Any] | Any | float | Unknown | tuple[float | Any | Unknown, NDArray[float64]]" and "floating[Any] | Any | float | Unknown | tuple[float | Any | Unknown, NDArray[float64]]"
+ .../projects/scikit-learn/sklearn/gaussian_process/tests/test_gpc.py:70:12 - error: Operator ">" not supported for types "floating[Any] | Any | float | Unknown | tuple[float | Unknown | Any, NDArray[float64]]" and "floating[Any] | Any | float | Unknown | tuple[float | Unknown | Any, NDArray[float64]]"
- Operator ">" not supported for types "float" and "tuple[float | Any | Unknown, NDArray[float64]]"
+ Operator ">" not supported for types "float" and "tuple[float | Unknown | Any, NDArray[float64]]"
- Operator ">" not supported for types "tuple[float | Any | Unknown, NDArray[float64]]" and "float" (reportOperatorIssue)
+ Operator ">" not supported for types "tuple[float | Unknown | Any, NDArray[float64]]" and "float" (reportOperatorIssue)
- .../projects/scikit-learn/sklearn/gaussian_process/tests/test_gpc.py:80:9 - error: Argument of type "floating[Any] | Any | float | Unknown | tuple[float | Any | Unknown, NDArray[float64]]" cannot be assigned to parameter "actual" of type "_NumericArrayLike" in function "assert_almost_equal"
+ .../projects/scikit-learn/sklearn/gaussian_process/tests/test_gpc.py:80:9 - error: Argument of type "floating[Any] | Any | float | Unknown | tuple[float | Unknown | Any, NDArray[float64]]" cannot be assigned to parameter "actual" of type "_NumericArrayLike" in function "assert_almost_equal"
- Type "floating[Any] | Any | float | Unknown | tuple[float | Any | Unknown, NDArray[float64]]" is not assignable to type "_NumericArrayLike"
+ Type "floating[Any] | Any | float | Unknown | tuple[float | Unknown | Any, NDArray[float64]]" is not assignable to type "_NumericArrayLike"
- Type "tuple[float | Any | Unknown, NDArray[float64]]" is not assignable to type "_NumericArrayLike"
+ Type "tuple[float | Unknown | Any, NDArray[float64]]" is not assignable to type "_NumericArrayLike"
- "tuple[float | Any | Unknown, NDArray[float64]]" is incompatible with protocol "_SupportsArray[dtype[numpy.bool[builtins.bool]] | dtype[number[Any, int | float | complex]]]"
+ "tuple[float | Unknown | Any, NDArray[float64]]" is incompatible with protocol "_SupportsArray[dtype[numpy.bool[builtins.bool]] | dtype[number[Any, int | float | complex]]]"
- "tuple[float | Any | Unknown, NDArray[float64]]" is incompatible with protocol "_NestedSequence[_SupportsArray[dtype[numpy.bool[builtins.bool]] | dtype[number[Any, int | float | complex]]]]"
+ "tuple[float | Unknown | Any, NDArray[float64]]" is incompatible with protocol "_NestedSequence[_SupportsArray[dtype[numpy.bool[builtins.bool]] | dtype[number[Any, int | float | complex]]]]"
- .../projects/scikit-learn/sklearn/gaussian_process/tests/test_gpc.py:80:57 - error: Argument of type "floating[Any] | Any | float | Unknown | tuple[float | Any | Unknown, NDArray[float64]]" cannot be assigned to parameter "desired" of type "_NumericArrayLike" in function "assert_almost_equal"
+ .../projects/scikit-learn/sklearn/gaussian_process/tests/test_gpc.py:80:57 - error: Argument of type "floating[Any] | Any | float | Unknown | tuple[float | Unknown | Any, NDArray[float64]]" cannot be assigned to parameter "desired" of type "_NumericArrayLike" in function "assert_almost_equal"
... (truncated 104 lines) ...
pip (https://github.com/pypa/pip)
+ .../projects/pip/src/pip/_vendor/distro/distro.py:61:19 - error: Argument to class must be a base class (reportGeneralTypeIssues)
+ .../projects/pip/src/pip/_vendor/distro/distro.py:67:16 - error: Argument to class must be a base class (reportGeneralTypeIssues)
- 1107 errors, 27 warnings, 0 informations
+ 1109 errors, 27 warnings, 0 informations
pycryptodome (https://github.com/Legrandin/pycryptodome)
- .../projects/pycryptodome/lib/Crypto/PublicKey/DSA.py:388:26 - error: Operator "+" not supported for types "Unbound | Unknown" and "bytes"
- Operator "+" not supported for types "Unbound" and "bytes" when expected type is "bytes | bytearray | memoryview[int] | None" (reportOperatorIssue)
- .../projects/pycryptodome/lib/Crypto/PublicKey/DSA.py:400:32 - error: Argument of type "IntegerBase" cannot be assigned to parameter "candidate" of type "int" in function "test_probable_prime"
... (truncated 375 lines) ...``` |
erictraut
added a commit
that referenced
this pull request
Sep 1, 2025
* main: Changed the evaluated type of `__class__` from `type[Self]` to `type[<Enclosing class]`. This addresses #10685. (#10874) Added optimization that reduces the number of Uri objects that need to be created during type evaluation. This is an attempt to address #10832. (#10872) Fixed bug that causes a false negative when using unquoted types in a TypedDict functional class definition if the types are forward declared. This addresses #10612. (#10869) Fixed bug that resulted in false negative when backslash followed by line feed occurs at end of file. This addresses #10814. (#10867) Fixed false negative when a keyword parameter in a child class method overrides a method with a `**kwargs` in the parent and the type is incompatible. This addresses #10815. (#10866) Fixed regression introduced in 1.1.343 that results in nondeterministic (order-dependent) type evaluation under certain circumstances involving recursive type aliases. This addresses #10850. (#10865) Revert "Added support for tracking multiple constraint sets when performing protocol matching. This allows protocols with overloaded methods to contribute independent constraint sets. This addresses #9835. (#9864)" (#10863) Fixed bug that contributes to out-of-memory crashes under certain circumstances where a module's transitive import graph is very large and may not fit within the available heap space. (#10862) Bump tmp from 0.2.3 to 0.2.5 in /packages/vscode-pyright (#10824) Added support for `match_args` dataclass parameter. This addresses #10858. (#10861) Fixed bug that results in false negative when a `closed=False` is used in `TypedDict` that subclasses from a non-open `TypedDict` base class. This addresses #10859. (#10860) Revert "Reverted a recent change that appears to have affected performance on some projects. This attempts to address #10832. (#10841)" Improved performance of import resolution when there are large number… (#10855) Document editable installs with uv (#10854) Fixed a bug that results in spurious errors if a class decorator is a… (#10846) Fixed a bug that results in false positive errors when using `object` methods (like `__eq__`) on a `Sentinel` instance. This addresses #10773. (#10844) Fixed bug that results in incorrect literal math results for bitwise negation. This addresses #10834. (#10842) Reverted a recent change that appears to have affected performance on some projects. This attempts to address #10832. (#10841) pull-pylance-with-pyright-1.1.403-20250820-201137 (#10831)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
…ic (order-dependent) type evaluation under certain circumstances involving recursive type aliases. This addresses #10850.