Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

simplify hint diagnostics into a single separate diagnostic category and report all baselined diagnostics with it #845

Merged
merged 1 commit into from
Nov 4, 2024

Conversation

DetachHead
Copy link
Owner

No description provided.

This comment has been minimized.

This comment has been minimized.

This comment has been minimized.

…and report all baselined diagnostics with it
@DetachHead DetachHead merged commit 7032aa3 into main Nov 4, 2024
20 checks passed
Copy link
Contributor

github-actions bot commented Nov 4, 2024

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

sympy (https://github.com/sympy/sympy)
-     Type of "P" is "(condition: Unknown, given_condition: Unknown | None = None, numsamples: Unknown | None = None, evaluate: bool = True, **kwargs: Unknown) -> (Unknown | Any | BernoulliDistribution | Probability | Self@Expr | tuple[Unknown, ...] | Sum | Order | Piecewise | Basic | Equality | Lambda | Relational | Unequality | int | None)" (reportUnknownVariableType)
+     Type of "P" is "(condition: Unknown, given_condition: Unknown | None = None, numsamples: Unknown | None = None, evaluate: bool = True, **kwargs: Unknown) -> (Unknown | Any | BernoulliDistribution | Probability | Self@Expr | tuple[Unknown, ...] | Sum | Order | Piecewise | Basic | Equality | Lambda | int | None)" (reportUnknownVariableType)
-     Type of "E" is "(expr: Unknown, condition: Unknown | None = None, numsamples: Unknown | None = None, evaluate: bool = True, **kwargs: Unknown) -> (Unknown | Basic | Expectation | tuple[Unknown, ...] | Sum | Self@Expr | Order | Any | Piecewise | Equality | Relational | Unequality | Integral | ExpectationMatrix | Literal[0] | None)" (reportUnknownVariableType)
+     Type of "E" is "(expr: Unknown, condition: Unknown | None = None, numsamples: Unknown | None = None, evaluate: bool = True, **kwargs: Unknown) -> (Unknown | Basic | Expectation | tuple[Unknown, ...] | Sum | Self@Expr | Order | Any | Piecewise | Equality | Integral | ExpectationMatrix | Literal[0] | None)" (reportUnknownVariableType)
-     Type of "expectation" is "(expr: Unknown, var: Unknown, evaluate: bool = True, **kwargs: Unknown) -> (Any | tuple[Unknown, ...] | Unknown | Sum | Self@Expr | Order | Piecewise | Basic | Equality | Relational | Unequality | Literal[0] | None)" (reportUnknownMemberType)
+     Type of "expectation" is "(expr: Unknown, var: Unknown, evaluate: bool = True, **kwargs: Unknown) -> (Any | tuple[Unknown, ...] | Unknown | Sum | Self@Expr | Order | Piecewise | Basic | Equality | Literal[0] | None)" (reportUnknownMemberType)
-     Type of "expectation" is "(expr: Unknown, var: Unknown, evaluate: bool = True, **kwargs: Unknown) -> (Any | tuple[Unknown, ...] | Unknown | Sum | Self@Expr | Order | Piecewise | Basic | Equality | Relational | Unequality | Literal[0] | None)" (reportUnknownMemberType)
+     Type of "expectation" is "(expr: Unknown, var: Unknown, evaluate: bool = True, **kwargs: Unknown) -> (Any | tuple[Unknown, ...] | Unknown | Sum | Self@Expr | Order | Piecewise | Basic | Equality | Literal[0] | None)" (reportUnknownMemberType)
-   /tmp/mypy_primer/projects/sympy/sympy/stats/tests/test_discrete_rv.py:39:12 - error: Operator "-" not supported for types "Any | tuple[Unknown, ...] | Unknown | Sum | Self@Expr | Order | Piecewise | Basic | Equality | Relational | Unequality | Literal[0] | None" and "Any | Unknown | Expr | int"
+   /tmp/mypy_primer/projects/sympy/sympy/stats/tests/test_discrete_rv.py:39:12 - error: Operator "-" not supported for types "Any | tuple[Unknown, ...] | Unknown | Sum | Self@Expr | Order | Piecewise | Basic | Equality | Literal[0] | None" and "Any | Unknown | Expr | int"
-     Operator "-" not supported for types "Equality" and "int"
-     Operator "-" not supported for types "Relational" and "int"
-     Operator "-" not supported for types "Unequality" and "int" (reportOperatorIssue)
+     Operator "-" not supported for types "Equality" and "int" (reportOperatorIssue)
-     Type of "expectation" is "(expr: Unknown, var: Unknown, evaluate: bool = True, **kwargs: Unknown) -> (Any | tuple[Unknown, ...] | Unknown | Sum | Self@Expr | Order | Piecewise | Basic | Equality | Relational | Unequality | Literal[0] | None)" (reportUnknownMemberType)
+     Type of "expectation" is "(expr: Unknown, var: Unknown, evaluate: bool = True, **kwargs: Unknown) -> (Any | tuple[Unknown, ...] | Unknown | Sum | Self@Expr | Order | Piecewise | Basic | Equality | Literal[0] | None)" (reportUnknownMemberType)
-   /tmp/mypy_primer/projects/sympy/sympy/stats/tests/test_discrete_rv.py:39:37 - error: Operator "**" not supported for types "Any | tuple[Unknown, ...] | Unknown | Sum | Self@Expr | Order | Piecewise | Basic | Equality | Relational | Unequality | Literal[0] | None" and "Literal[2]"
+   /tmp/mypy_primer/projects/sympy/sympy/stats/tests/test_discrete_rv.py:39:37 - error: Operator "**" not supported for types "Any | tuple[Unknown, ...] | Unknown | Sum | Self@Expr | Order | Piecewise | Basic | Equality | Literal[0] | None" and "Literal[2]"
-     Operator "**" not supported for types "Equality" and "Literal[2]"
-     Operator "**" not supported for types "Relational" and "Literal[2]"
-     Operator "**" not supported for types "Unequality" and "Literal[2]" (reportOperatorIssue)
+     Operator "**" not supported for types "Equality" and "Literal[2]" (reportOperatorIssue)
-     Type of "expectation" is "(expr: Unknown, var: Unknown, evaluate: bool = True, **kwargs: Unknown) -> (Any | tuple[Unknown, ...] | Unknown | Sum | Self@Expr | Order | Piecewise | Basic | Equality | Relational | Unequality | Literal[0] | None)" (reportUnknownMemberType)
+     Type of "expectation" is "(expr: Unknown, var: Unknown, evaluate: bool = True, **kwargs: Unknown) -> (Any | tuple[Unknown, ...] | Unknown | Sum | Self@Expr | Order | Piecewise | Basic | Equality | Literal[0] | None)" (reportUnknownMemberType)
-     Type of "expectation" is "(expr: Unknown, var: Unknown, evaluate: bool = True, **kwargs: Unknown) -> (Any | tuple[Unknown, ...] | Unknown | Sum | Self@Expr | Order | Piecewise | Basic | Equality | Relational | Unequality | Literal[0] | None)" (reportUnknownMemberType)
+     Type of "expectation" is "(expr: Unknown, var: Unknown, evaluate: bool = True, **kwargs: Unknown) -> (Any | tuple[Unknown, ...] | Unknown | Sum | Self@Expr | Order | Piecewise | Basic | Equality | Literal[0] | None)" (reportUnknownMemberType)
-   /tmp/mypy_primer/projects/sympy/sympy/stats/tests/test_discrete_rv.py:69:12 - error: Operator "-" not supported for types "Any | tuple[Unknown, ...] | Unknown | Sum | Self@Expr | Order | Piecewise | Basic | Equality | Relational | Unequality | Literal[0] | None" and "Any | Unknown | Expr | int"
+   /tmp/mypy_primer/projects/sympy/sympy/stats/tests/test_discrete_rv.py:69:12 - error: Operator "-" not supported for types "Any | tuple[Unknown, ...] | Unknown | Sum | Self@Expr | Order | Piecewise | Basic | Equality | Literal[0] | None" and "Any | Unknown | Expr | int"
-     Operator "-" not supported for types "Equality" and "int"
-     Operator "-" not supported for types "Relational" and "int"
-     Operator "-" not supported for types "Unequality" and "int" (reportOperatorIssue)
+     Operator "-" not supported for types "Equality" and "int" (reportOperatorIssue)
-     Type of "expectation" is "(expr: Unknown, var: Unknown, evaluate: bool = True, **kwargs: Unknown) -> (Any | tuple[Unknown, ...] | Unknown | Sum | Self@Expr | Order | Piecewise | Basic | Equality | Relational | Unequality | Literal[0] | None)" (reportUnknownMemberType)
+     Type of "expectation" is "(expr: Unknown, var: Unknown, evaluate: bool = True, **kwargs: Unknown) -> (Any | tuple[Unknown, ...] | Unknown | Sum | Self@Expr | Order | Piecewise | Basic | Equality | Literal[0] | None)" (reportUnknownMemberType)
-   /tmp/mypy_primer/projects/sympy/sympy/stats/tests/test_discrete_rv.py:69:37 - error: Operator "**" not supported for types "Any | tuple[Unknown, ...] | Unknown | Sum | Self@Expr | Order | Piecewise | Basic | Equality | Relational | Unequality | Literal[0] | None" and "Literal[2]"
+   /tmp/mypy_primer/projects/sympy/sympy/stats/tests/test_discrete_rv.py:69:37 - error: Operator "**" not supported for types "Any | tuple[Unknown, ...] | Unknown | Sum | Self@Expr | Order | Piecewise | Basic | Equality | Literal[0] | None" and "Literal[2]"
-     Operator "**" not supported for types "Equality" and "Literal[2]"
-     Operator "**" not supported for types "Relational" and "Literal[2]"
-     Operator "**" not supported for types "Unequality" and "Literal[2]" (reportOperatorIssue)
+     Operator "**" not supported for types "Equality" and "Literal[2]" (reportOperatorIssue)
-     Type of "expand" is "Unknown | Any | ((deep: bool = True, modulus: Unknown | None = None, power_base: bool = True, power_exp: bool = True, mul: bool = True, log: bool = True, multinomial: bool = True, basic: bool = True, **hints: Unknown) -> (Unknown | Order | Any | Expr))" (reportUnknownMemberType)
+     Type of "expand" is "Unknown | Any | ((deep: bool = True, modulus: Unknown | None = None, power_base: bool = True, power_exp: bool = True, mul: bool = True, log: bool = True, multinomial: bool = True, basic: bool = True, **hints: Unknown) -> (Unknown | Order | Any | Self@Expr))" (reportUnknownMemberType)
-     Type of "expand" is "((**hints: Unknown) -> (ZeroMatrix | VarianceMatrix | Unknown | Expr)) | ((**hints: Unknown) -> (Unknown | Variance | Expr)) | Unknown | Any | ((deep: bool = True, modulus: Unknown | None = None, power_base: bool = True, power_exp: bool = True, mul: bool = True, log: bool = True, multinomial: bool = True, basic: bool = True, **hints: Unknown) -> (Unknown | Order | Any | CentralMoment))" (reportUnknownMemberType)
+     Type of "expand" is "((**hints: Unknown) -> (ZeroMatrix | VarianceMatrix | Unknown | Expr)) | ((**hints: Unknown) -> (Unknown | Variance | Expr)) | Unknown | Any | ((deep: bool = True, modulus: Unknown | None = None, power_base: bool = True, power_exp: bool = True, mul: bool = True, log: bool = True, multinomial: bool = True, basic: bool = True, **hints: Unknown) -> (Unknown | Order | Any | Self@Expr))" (reportUnknownMemberType)
+   /tmp/mypy_primer/projects/sympy/sympy/stats/tests/test_discrete_rv.py:223:20 - error: Invalid conditional operand of type "_NotImplementedType | StrictLessThan | Unknown | Equality | Relational | Unequality"
+     Method __bool__ for type "StrictLessThan" returns type "NoReturn" rather than "bool"

... (truncated 805 lines) ...

AutoSplit (https://github.com/Toufool/AutoSplit): 297.50x slower (0.1s -> 16.4s in a single noisy sample)

@DetachHead DetachHead deleted the hints branch November 4, 2024 10:29
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