-
Notifications
You must be signed in to change notification settings - Fork 21
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
don't report reportUnnecessaryComparison
when using assert_never
in an intentionally unreachable case in a match statement
#593
Merged
Conversation
This file contains 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
… in an intentionally unreachable case in a match statement
DetachHead
changed the title
don't report
don't report Aug 19, 2024
reportUnnecessaryComparison
whern using assert_never
in an intentionally unreachable case in a match statementreportUnnecessaryComparison
when using assert_never
in an intentionally unreachable case in a match statement
KotlinIsland
approved these changes
Aug 19, 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 | 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 | Relational | Unequality | 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 | Order | Any | Piecewise | Equality | Relational | Unequality | Integral | ExpectationMatrix | 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 | None)" (reportUnknownVariableType)
- Type of "covariance" is "(X: Unknown, Y: Unknown, condition: Unknown | None = None, **kwargs: Unknown) -> (CrossCovarianceMatrix | Covariance | Unknown | Basic | Expectation | tuple[Unknown, ...] | Sum | Order | Any | Piecewise | Equality | Relational | Unequality | Integral | ExpectationMatrix | None)" (reportUnknownVariableType)
+ Type of "covariance" is "(X: Unknown, Y: Unknown, condition: Unknown | None = None, **kwargs: Unknown) -> (CrossCovarianceMatrix | Covariance | Unknown | Basic | Expectation | tuple[Unknown, ...] | Sum | Self@Expr | Order | Any | Piecewise | Equality | Relational | Unequality | Integral | ExpectationMatrix | None)" (reportUnknownVariableType)
- /tmp/mypy_primer/projects/sympy/sympy/stats/tests/test_finite_rv.py:33:23 - error: Operator "/" not supported for types "Unknown | Any | BernoulliDistribution | Probability | tuple[Unknown, ...] | Sum | Order | Piecewise | Basic | Equality | Lambda | Relational | Unequality | int | None" and "Unknown | Any | BernoulliDistribution | Probability | tuple[Unknown, ...] | Sum | Order | Piecewise | Basic | Equality | Lambda | Relational | Unequality | int | None"
+ /tmp/mypy_primer/projects/sympy/sympy/stats/tests/test_finite_rv.py:33:23 - error: Operator "/" not supported for types "Unknown | Any | BernoulliDistribution | Probability | Self@Expr | tuple[Unknown, ...] | Sum | Order | Piecewise | Basic | Equality | Relational | Unequality | Lambda | int | None" and "Unknown | Any | BernoulliDistribution | Probability | Self@Expr | tuple[Unknown, ...] | Sum | Order | Piecewise | Basic | Equality | Relational | Unequality | Lambda | int | None"
+ Operator "/" not supported for types "BernoulliDistribution" and "Expr*"
- Operator "/" not supported for types "BernoulliDistribution" and "Basic"
- /tmp/mypy_primer/projects/sympy/sympy/stats/tests/test_finite_rv.py:34:23 - error: Operator "*" not supported for types "Unknown | Any | BernoulliDistribution | Probability | tuple[Unknown, ...] | Sum | Order | Piecewise | Basic | Equality | Lambda | Relational | Unequality | int | None" and "Unknown | Any | BernoulliDistribution | Probability | tuple[Unknown, ...] | Sum | Order | Piecewise | Basic | Equality | Lambda | Relational | Unequality | int | None"
+ /tmp/mypy_primer/projects/sympy/sympy/stats/tests/test_finite_rv.py:34:23 - error: Operator "*" not supported for types "Unknown | Any | BernoulliDistribution | Probability | Self@Expr | tuple[Unknown, ...] | Sum | Order | Piecewise | Basic | Equality | Relational | Unequality | Lambda | int | None" and "Unknown | Any | BernoulliDistribution | Probability | Self@Expr | tuple[Unknown, ...] | Sum | Order | Piecewise | Basic | Equality | Relational | Unequality | Lambda | int | None"
+ Operator "*" not supported for types "BernoulliDistribution" and "Expr*"
- Operator "*" not supported for types "BernoulliDistribution" and "Basic"
- /tmp/mypy_primer/projects/sympy/sympy/stats/tests/test_finite_rv.py:34:23 - error: Operator "/" not supported for types "Unknown | Any | tuple[Unknown, ...] | int" and "Unknown | Any | BernoulliDistribution | Probability | tuple[Unknown, ...] | Sum | Order | Piecewise | Basic | Equality | Lambda | Relational | Unequality | int | None"
+ /tmp/mypy_primer/projects/sympy/sympy/stats/tests/test_finite_rv.py:34:23 - error: Operator "/" not supported for types "Unknown | Any | tuple[Unknown, ...] | int" and "Unknown | Any | BernoulliDistribution | Probability | Self@Expr | tuple[Unknown, ...] | Sum | Order | Piecewise | Basic | Equality | Relational | Unequality | Lambda | int | None"
+ Operator "/" not supported for types "tuple[Unknown, ...]" and "Expr*"
- Operator "/" not supported for types "tuple[Unknown, ...]" and "Basic"
- /tmp/mypy_primer/projects/sympy/sympy/stats/tests/test_finite_rv.py:181:32 - error: Return type of lambda, "Unknown | Any | BernoulliDistribution | Probability | tuple[Unknown, ...] | Sum | Order | Piecewise | Basic | Equality | Lambda | Relational | Unequality | int | None", is partially unknown (reportUnknownLambdaType)
+ /tmp/mypy_primer/projects/sympy/sympy/stats/tests/test_finite_rv.py:181:32 - error: Return type of lambda, "Unknown | Any | BernoulliDistribution | Probability | Self@Expr | tuple[Unknown, ...] | Sum | Order | Piecewise | Basic | Equality | Relational | Unequality | Lambda | int | None", is partially unknown (reportUnknownLambdaType)
- /tmp/mypy_primer/projects/sympy/sympy/stats/tests/test_finite_rv.py:253:32 - error: Return type of lambda, "Unknown | Any | BernoulliDistribution | Probability | tuple[Unknown, ...] | Sum | Order | Piecewise | Basic | Equality | Lambda | Relational | Unequality | int | None", is partially unknown (reportUnknownLambdaType)
+ /tmp/mypy_primer/projects/sympy/sympy/stats/tests/test_finite_rv.py:253:32 - error: Return type of lambda, "Unknown | Any | BernoulliDistribution | Probability | Self@Expr | tuple[Unknown, ...] | Sum | Order | Piecewise | Basic | Equality | Relational | Unequality | Lambda | int | None", is partially unknown (reportUnknownLambdaType)
- /tmp/mypy_primer/projects/sympy/sympy/stats/tests/test_finite_rv.py:308:41 - error: Return type of lambda, "Unknown | Any | BernoulliDistribution | Probability | tuple[Unknown, ...] | Sum | Order | Piecewise | Basic | Equality | Lambda | Relational | Unequality | int | None", is partially unknown (reportUnknownLambdaType)
+ /tmp/mypy_primer/projects/sympy/sympy/stats/tests/test_finite_rv.py:308:41 - error: Return type of lambda, "Unknown | Any | BernoulliDistribution | Probability | Self@Expr | tuple[Unknown, ...] | Sum | Order | Piecewise | Basic | Equality | Relational | Unequality | Lambda | int | None", is partially unknown (reportUnknownLambdaType)
- Type of "expand" is "((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 | RandomSymbol)) | Unknown | ((**hints: Unknown) -> (Basic | Add | Unknown | GenericIdentity* | Order | Expectation)) | ((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 | Sum)) | ((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)) | 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 | Piecewise)) | ((**kwargs: Unknown) -> Equality) | ((**kwargs: Unknown) -> Relational) | ((**kwargs: Unknown) -> Unequality) | ((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 | Integral)) | ((**hints: Unknown) -> (Basic | Add | ExpectationMatrix | Unknown | GenericIdentity* | Order))" (reportUnknownMemberType)
... (truncated 1190 lines) ...
mitmproxy (https://github.com/mitmproxy/mitmproxy)
- /tmp/mypy_primer/projects/mitmproxy/mitmproxy/addons/next_layer.py:339:18 - error: Pattern will never be matched for subject type "Never" (reportUnnecessaryComparison)
- /tmp/mypy_primer/projects/mitmproxy/mitmproxy/addons/next_layer.py:398:18 - error: Pattern will never be matched for subject type "Never" (reportUnnecessaryComparison)
- /tmp/mypy_primer/projects/mitmproxy/mitmproxy/proxy/layers/modes.py:81:18 - error: Pattern will never be matched for subject type "Never" (reportUnnecessaryComparison)
- 32701 errors, 0 warnings, 0 notes
+ 32698 errors, 0 warnings, 0 notes
|
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.
fixes #469