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

fix inlay hints appearing on super() calls #847

Merged
merged 1 commit into from
Nov 5, 2024
Merged

Conversation

DetachHead
Copy link
Owner

fixes #833

This comment has been minimized.

@DetachHead DetachHead force-pushed the inlay-hint-super-fix branch from 61c3561 to 3fa13a9 Compare November 5, 2024 13:40
Copy link
Contributor

github-actions bot commented Nov 5, 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 | Relational | Unequality | Lambda | int | None)" (reportUnknownVariableType)
-     Type of "rewrite" is "Unknown | Any | ((..., deep: bool = True) -> (BernoulliDistribution | Any)) | ((..., deep: bool = True) -> (Probability | Any)) | ((..., deep: bool = True) -> (Self@Expr | Any)) | ((..., deep: bool = True) -> (Sum | Any)) | ((..., deep: bool = True) -> (Order | Any)) | ((..., deep: bool = True) -> (Piecewise | Any)) | ((..., deep: bool = True) -> (Basic | Any)) | ((..., deep: bool = True) -> (Equality | Any)) | ((..., deep: bool = True) -> (Lambda | Any)) | ((..., deep: bool = True) -> (Relational | Any)) | ((..., deep: bool = True) -> (Unequality | Any))" (reportUnknownMemberType)
+     Type of "rewrite" is "Unknown | Any | ((..., deep: bool = True) -> (BernoulliDistribution | Any)) | ((..., deep: bool = True) -> (Probability | Any)) | ((..., deep: bool = True) -> (Self@Expr | Any)) | ((..., deep: bool = True) -> (Sum | Any)) | ((..., deep: bool = True) -> (Order | Any)) | ((..., deep: bool = True) -> (Piecewise | Any)) | ((..., deep: bool = True) -> (Basic | Any)) | ((..., deep: bool = True) -> (Equality | Any)) | ((..., deep: bool = True) -> (Relational | Any)) | ((..., deep: bool = True) -> (Unequality | Any)) | ((..., deep: bool = True) -> (Lambda | Any))" (reportUnknownMemberType)
-     Type of "rewrite" is "Unknown | Any | ((..., deep: bool = True) -> (BernoulliDistribution | Any)) | ((..., deep: bool = True) -> (Probability | Any)) | ((..., deep: bool = True) -> (Self@Expr | Any)) | ((..., deep: bool = True) -> (Sum | Any)) | ((..., deep: bool = True) -> (Order | Any)) | ((..., deep: bool = True) -> (Piecewise | Any)) | ((..., deep: bool = True) -> (Basic | Any)) | ((..., deep: bool = True) -> (Equality | Any)) | ((..., deep: bool = True) -> (Lambda | Any)) | ((..., deep: bool = True) -> (Relational | Any)) | ((..., deep: bool = True) -> (Unequality | Any))" (reportUnknownMemberType)
+     Type of "rewrite" is "Unknown | Any | ((..., deep: bool = True) -> (BernoulliDistribution | Any)) | ((..., deep: bool = True) -> (Probability | Any)) | ((..., deep: bool = True) -> (Self@Expr | Any)) | ((..., deep: bool = True) -> (Sum | Any)) | ((..., deep: bool = True) -> (Order | Any)) | ((..., deep: bool = True) -> (Piecewise | Any)) | ((..., deep: bool = True) -> (Basic | Any)) | ((..., deep: bool = True) -> (Equality | Any)) | ((..., deep: bool = True) -> (Relational | Any)) | ((..., deep: bool = True) -> (Unequality | Any)) | ((..., deep: bool = True) -> (Lambda | Any))" (reportUnknownMemberType)
-     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 | Relational | Unequality | Lambda | int | None)" (reportUnknownVariableType)
-   /tmp/mypy_primer/projects/sympy/sympy/stats/tests/test_rv.py:177:32 - warning: Return type of lambda, "Unknown | Any | BernoulliDistribution | Probability | Self@Expr | 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_rv.py:177:32 - warning: 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_rv.py:219:31 - warning: Return type of lambda, "Unknown | Any | BernoulliDistribution | Probability | Self@Expr | 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_rv.py:219:31 - warning: 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_rv.py:366:32 - warning: Return type of lambda, "Unknown | Any | BernoulliDistribution | Probability | Self@Expr | 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_rv.py:366:32 - warning: 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_rv.py:367:32 - warning: Return type of lambda, "Unknown | Any | BernoulliDistribution | Probability | Self@Expr | 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_rv.py:367:32 - warning: 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 "U" is "Unknown | Any | BernoulliDistribution | Probability | Self@Expr | tuple[Unknown, ...] | Sum | Order | Piecewise | Basic | Equality | Lambda | Relational | Unequality | int | None" (reportUnknownVariableType)
+     Type of "U" is "Unknown | Any | BernoulliDistribution | Probability | Self@Expr | tuple[Unknown, ...] | Sum | Order | Piecewise | Basic | Equality | Relational | Unequality | Lambda | int | None" (reportUnknownVariableType)
-     Type of "V" is "Unknown | Any | BernoulliDistribution | Probability | Self@Expr | tuple[Unknown, ...] | Sum | Order | Piecewise | Basic | Equality | Lambda | Relational | Unequality | int | None" (reportUnknownVariableType)
+     Type of "V" is "Unknown | Any | BernoulliDistribution | Probability | Self@Expr | tuple[Unknown, ...] | Sum | Order | Piecewise | Basic | Equality | Relational | Unequality | Lambda | int | None" (reportUnknownVariableType)
-     Type of "W" is "Unknown | Any | BernoulliDistribution | Probability | Self@Expr | tuple[Unknown, ...] | Sum | Order | Piecewise | Basic | Equality | Lambda | Relational | Unequality | int | None" (reportUnknownVariableType)
+     Type of "W" is "Unknown | Any | BernoulliDistribution | Probability | Self@Expr | tuple[Unknown, ...] | Sum | Order | Piecewise | Basic | Equality | Relational | Unequality | Lambda | 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 | 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)
-     Argument type is "Unknown | Any | BernoulliDistribution | Probability | Self@Expr | tuple[Unknown, ...] | Sum | Order | Piecewise | Basic | Equality | Lambda | Relational | Unequality | int | None" (reportUnknownArgumentType)
+     Argument type is "Unknown | Any | BernoulliDistribution | Probability | Self@Expr | tuple[Unknown, ...] | Sum | Order | Piecewise | Basic | Equality | Relational | Unequality | Lambda | int | None" (reportUnknownArgumentType)
-   /tmp/mypy_primer/projects/sympy/sympy/stats/tests/test_stochastic_process.py:126:14 - warning: Argument type is unknown
-     Argument corresponds to parameter "condition" in function "probability" (reportUnknownArgumentType)
-   /tmp/mypy_primer/projects/sympy/sympy/stats/tests/test_stochastic_process.py:128:14 - warning: Argument type is unknown
-     Argument corresponds to parameter "condition" in function "probability" (reportUnknownArgumentType)

... (truncated 1071 lines) ...

imagehash (https://github.com/JohannesBuchner/imagehash): 297.96x slower (0.0s -> 10.3s in a single noisy sample)

@DetachHead DetachHead merged commit a162d08 into main Nov 5, 2024
20 checks passed
@DetachHead DetachHead deleted the inlay-hint-super-fix branch November 5, 2024 14:48
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.

generic inlay hint incorrectly appears on super() call
1 participant