Skip to content

Fixed regression that results in a false positive when using the `pyd…#11084

Merged
erictraut merged 1 commit intomainfrom
issue-11060
Nov 2, 2025
Merged

Fixed regression that results in a false positive when using the `pyd…#11084
erictraut merged 1 commit intomainfrom
issue-11060

Conversation

@erictraut
Copy link
Collaborator

…antic.dataclasses.dataclass` decorator. This addresses #11060.

…antic.dataclasses.dataclass` decorator. This addresses #11060.
@github-actions
Copy link
Contributor

github-actions bot commented Nov 2, 2025

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

sympy (https://github.com/sympy/sympy)
+   .../projects/sympy/sympy/solvers/tests/test_solveset.py:444:30 - error: Cannot access attribute "limit_denominator" for class "NaN"
+     Attribute "limit_denominator" is unknown (reportAttributeAccessIssue)
+   .../projects/sympy/sympy/solvers/tests/test_solveset.py:444:30 - error: Cannot access attribute "limit_denominator" for class "ComplexInfinity"
+     Attribute "limit_denominator" is unknown (reportAttributeAccessIssue)
-   .../projects/sympy/sympy/solvers/tests/test_solveset.py:619:16 - error: No overloads for "__new__" match the provided arguments (reportCallIssue)
-   .../projects/sympy/sympy/solvers/tests/test_solveset.py:619:19 - error: Argument of type "Expr | Unknown | float" cannot be assigned to parameter "arg" of type "Expr" in function "__new__"
-     Type "Expr | Unknown | float" is not assignable to type "Expr"
-       "float" is not assignable to "Expr" (reportArgumentType)
-   .../projects/sympy/sympy/solvers/tests/test_solveset.py:624:16 - error: No overloads for "__new__" match the provided arguments (reportCallIssue)
-   .../projects/sympy/sympy/solvers/tests/test_solveset.py:624:19 - error: Argument of type "Expr | Unknown | float" cannot be assigned to parameter "arg" of type "Expr" in function "__new__"
-     Type "Expr | Unknown | float" is not assignable to type "Expr"
-       "float" is not assignable to "Expr" (reportArgumentType)
-   .../projects/sympy/sympy/stats/joint_rv_types.py:575:27 - error: Argument of type "One | NegativeOne | Zero | Integer | NaN | ComplexInfinity | Rational | Unknown | Infinity | NegativeInfinity | Float | Number | Expr" cannot be assigned to parameter "stop" of type "SupportsIndex" in function "__new__"
+   .../projects/sympy/sympy/stats/joint_rv_types.py:575:27 - error: Argument of type "One | NegativeOne | Zero | Integer | NaN | ComplexInfinity | Rational | Infinity | NegativeInfinity | Float | Number | Expr" cannot be assigned to parameter "stop" of type "SupportsIndex" in function "__new__"
-     Type "One | NegativeOne | Zero | Integer | NaN | ComplexInfinity | Rational | Unknown | Infinity | NegativeInfinity | Float | Number | Expr" is not assignable to type "SupportsIndex"
+     Type "One | NegativeOne | Zero | Integer | NaN | ComplexInfinity | Rational | Infinity | NegativeInfinity | Float | Number | Expr" is not assignable to type "SupportsIndex"
-   .../projects/sympy/sympy/stats/rv_interface.py:450:42 - error: Operator "-" not supported for types "Unknown | Basic | Any" and "Rational | Unknown"
+   .../projects/sympy/sympy/stats/rv_interface.py:450:42 - error: Operator "-" not supported for types "Unknown | Basic | Any" and "Rational | NaN | ComplexInfinity"
+     Operator "-" not supported for types "Basic" and "Rational"
+     Operator "-" not supported for types "Basic" and "NaN"
-     Operator "-" not supported for types "Basic" and "Rational" (reportOperatorIssue)
+     Operator "-" not supported for types "Basic" and "ComplexInfinity" (reportOperatorIssue)
-   .../projects/sympy/sympy/stats/symbolic_probability.py:74:9 - error: Method "doit" overrides class "Basic" in an incompatible manner
-     Return type mismatch: base method returns type "Basic", override returns type "Unknown | Any | BernoulliDistribution | Probability | Zero | One | tuple[Unknown, ...] | Sum | Expr | NaN | Piecewise | Basic | ComplexInfinity | Float | Infinity | Integer | Lambda | Mul | NegativeInfinity | NegativeOne | Number | Rational | Integral | Literal[0] | None"
-       Type "Unknown | Any | BernoulliDistribution | Probability | Zero | One | tuple[Unknown, ...] | Sum | Expr | NaN | Piecewise | Basic | ComplexInfinity | Float | Infinity | Integer | Lambda | Mul | NegativeInfinity | NegativeOne | Number | Rational | Integral | Literal[0] | None" is not assignable to type "Basic"
-         "Literal[0]" is not assignable to "Basic" (reportIncompatibleMethodOverride)
-   .../projects/sympy/sympy/stats/tests/test_continuous_rv.py:1542:12 - error: No overloads for "simplify" match the provided arguments (reportCallIssue)
-   .../projects/sympy/sympy/stats/tests/test_continuous_rv.py:1542:21 - error: Argument of type "Unknown | Any | BernoulliDistribution | Probability | Zero | One | tuple[Unknown, ...] | Sum | Expr | NaN | Piecewise | Basic | ComplexInfinity | Float | Infinity | Integer | Lambda | Mul | NegativeInfinity | NegativeOne | Number | Rational | Integral | Literal[0] | None" cannot be assigned to parameter "expr" of type "Basic" in function "simplify"
-     Type "Unknown | Any | BernoulliDistribution | Probability | Zero | One | tuple[Unknown, ...] | Sum | Expr | NaN | Piecewise | Basic | ComplexInfinity | Float | Infinity | Integer | Lambda | Mul | NegativeInfinity | NegativeOne | Number | Rational | Integral | Literal[0] | None" is not assignable to type "Basic"
-       "Literal[0]" is not assignable to "Basic" (reportArgumentType)
-   .../projects/sympy/sympy/stats/tests/test_continuous_rv.py:1544:12 - error: No overloads for "simplify" match the provided arguments (reportCallIssue)
-   .../projects/sympy/sympy/stats/tests/test_continuous_rv.py:1544:21 - error: Argument of type "Unknown | Any | BernoulliDistribution | Probability | Zero | One | tuple[Unknown, ...] | Sum | Expr | NaN | Piecewise | Basic | ComplexInfinity | Float | Infinity | Integer | Lambda | Mul | NegativeInfinity | NegativeOne | Number | Rational | Integral | Literal[0] | None" cannot be assigned to parameter "expr" of type "Basic" in function "simplify"
-     Type "Unknown | Any | BernoulliDistribution | Probability | Zero | One | tuple[Unknown, ...] | Sum | Expr | NaN | Piecewise | Basic | ComplexInfinity | Float | Infinity | Integer | Lambda | Mul | NegativeInfinity | NegativeOne | Number | Rational | Integral | Literal[0] | None" is not assignable to type "Basic"
-       "Literal[0]" is not assignable to "Basic" (reportArgumentType)
-   .../projects/sympy/sympy/stats/tests/test_continuous_rv.py:1549:12 - error: No overloads for "simplify" match the provided arguments (reportCallIssue)
-   .../projects/sympy/sympy/stats/tests/test_continuous_rv.py:1549:21 - error: Argument of type "Unknown | Any | BernoulliDistribution | Probability | Zero | One | tuple[Unknown, ...] | Sum | Expr | NaN | Piecewise | Basic | ComplexInfinity | Float | Infinity | Integer | Lambda | Mul | NegativeInfinity | NegativeOne | Number | Rational | Integral | Literal[0] | None" cannot be assigned to parameter "expr" of type "Basic" in function "simplify"
-     Type "Unknown | Any | BernoulliDistribution | Probability | Zero | One | tuple[Unknown, ...] | Sum | Expr | NaN | Piecewise | Basic | ComplexInfinity | Float | Infinity | Integer | Lambda | Mul | NegativeInfinity | NegativeOne | Number | Rational | Integral | Literal[0] | None" is not assignable to type "Basic"
-       "Literal[0]" is not assignable to "Basic" (reportArgumentType)
-   .../projects/sympy/sympy/stats/tests/test_finite_rv.py:33:23 - error: Operator "/" not supported for types "Unknown | Any | BernoulliDistribution | Probability | Zero | One | tuple[Unknown, ...] | Sum | Expr | NaN | Piecewise | Basic | ComplexInfinity | Float | Infinity | Integer | Lambda | Mul | NegativeInfinity | NegativeOne | Number | Rational | Integral | Literal[0] | None" and "Unknown | Any | BernoulliDistribution | Probability | Zero | One | tuple[Unknown, ...] | Sum | Expr | NaN | Piecewise | Basic | ComplexInfinity | Float | Infinity | Integer | Lambda | Mul | NegativeInfinity | NegativeOne | Number | Rational | Integral | Literal[0] | None"
+   .../projects/sympy/sympy/stats/tests/test_finite_rv.py:33:23 - error: Operator "/" not supported for types "Unknown | Any | BernoulliDistribution | Probability | Zero | One | Expr | Float | ComplexInfinity | NaN | Rational | Infinity | NegativeInfinity | _NotImplementedType | tuple[Unknown, ...] | Sum | Piecewise | Basic | Integer | Lambda | Mul | NegativeOne | Number | Integral | Literal[0] | None" and "Unknown | Any | BernoulliDistribution | Probability | Zero | One | Expr | Float | ComplexInfinity | NaN | Rational | Infinity | NegativeInfinity | _NotImplementedType | tuple[Unknown, ...] | Sum | Piecewise | Basic | Integer | Lambda | Mul | NegativeOne | Number | Integral | Literal[0] | None"
-   .../projects/sympy/sympy/stats/tests/test_finite_rv.py:34:23 - error: Operator "*" not supported for types "Unknown | Any | BernoulliDistribution | Probability | Zero | One | tuple[Unknown, ...] | Sum | Expr | NaN | Piecewise | Basic | ComplexInfinity | Float | Infinity | Integer | Lambda | Mul | NegativeInfinity | NegativeOne | Number | Rational | Integral | Literal[0] | None" and "Unknown | Any | BernoulliDistribution | Probability | Zero | One | tuple[Unknown, ...] | Sum | Expr | NaN | Piecewise | Basic | ComplexInfinity | Float | Infinity | Integer | Lambda | Mul | NegativeInfinity | NegativeOne | Number | Rational | Integral | Literal[0] | None"
+   .../projects/sympy/sympy/stats/tests/test_finite_rv.py:34:23 - error: Operator "*" not supported for types "Unknown | Any | BernoulliDistribution | Probability | Zero | One | Expr | Float | ComplexInfinity | NaN | Rational | Infinity | NegativeInfinity | _NotImplementedType | tuple[Unknown, ...] | Sum | Piecewise | Basic | Integer | Lambda | Mul | NegativeOne | Number | Integral | Literal[0] | None" and "Unknown | Any | BernoulliDistribution | Probability | Zero | One | Expr | Float | ComplexInfinity | NaN | Rational | Infinity | NegativeInfinity | _NotImplementedType | tuple[Unknown, ...] | Sum | Piecewise | Basic | Integer | Lambda | Mul | NegativeOne | Number | Integral | Literal[0] | None"
-     Operator "*" not supported for types "BernoulliDistribution" and "tuple[Unknown, ...]"
-     Operator "*" not supported for types "BernoulliDistribution" and "Sum"
-     Operator "*" not supported for types "BernoulliDistribution" and "None"
+     Operator "*" not supported for types "BernoulliDistribution" and "Float"

... (truncated 154 lines) ...

@erictraut erictraut merged commit 89825e1 into main Nov 2, 2025
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant