-
Notifications
You must be signed in to change notification settings - Fork 26
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 readonly property member access highlighting the entire expression as reaonly instead of just the member name #902
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
…n as readonly instead of just the member name
Diff from mypy_primer, showing the effect of this PR on open source code: sympy (https://github.com/sympy/sympy)
- Type of "n" is "Unknown | Overload[(n: int = 15, subs: dict[Basic, Basic | float] | None = None, maxn: int = 100, chop: bool = False, strict: bool = False, quad: str | None = None, verbose: bool = False) -> Expr, (n: int = 15, subs: dict[Basic, Basic | float] | None = None, maxn: int = 100, chop: bool = False, strict: bool = False, quad: str | None = None, verbose: bool = False) -> Basic]" (reportUnknownMemberType)
+ Type of "n" is "Unknown | Overload[(n: int = 15, subs: dict[Basic, Basic | float] | None = None, maxn: int = 100, chop: bool = False, strict: bool = False, quad: str | None = None, verbose: bool = False) -> Expr, (n: int = 15, subs: dict[Basic, Basic | float] | None = None, maxn: int = 100, chop: bool = False, strict: bool = False, quad: str | None = None, verbose: bool = False) -> Basic] | Any" (reportUnknownMemberType)
- /tmp/mypy_primer/projects/sympy/sympy/solvers/tests/test_solveset.py:506:20 - warning: Argument type is unknown
- Argument corresponds to parameter "args" in function "__new__" (reportUnknownArgumentType)
- Argument type is "Generator[_NotImplementedType | StrictLessThan | Unknown | Equality | Relational | Unequality, None, None]" (reportUnknownArgumentType)
+ Argument type is "Generator[_NotImplementedType | Unknown, None, None]" (reportUnknownArgumentType)
+ /tmp/mypy_primer/projects/sympy/sympy/solvers/tests/test_solveset.py:706:26 - warning: Argument type is Any
+ Argument corresponds to parameter "f" in function "solveset_real" (reportAny)
- Type of "number" is "Unknown | One | NegativeOne | Zero | Integer | Rational | NaN | ComplexInfinity | Half | Expr" (reportUnknownVariableType)
+ Type of "number" is "Unknown | One | NegativeOne | Zero | Integer | Rational | NaN | ComplexInfinity | Half | Infinity | NegativeInfinity | Float | _NotImplementedType | Expr" (reportUnknownVariableType)
+ /tmp/mypy_primer/projects/sympy/sympy/solvers/tests/test_solveset.py:2793:21 - warning: Argument type is Any
+ Argument corresponds to parameter "f" in function "solveset" (reportAny)
- Type of "eq" is "_NotImplementedType | GreaterThan | Unknown | Equality | Relational | Unequality" (reportUnknownVariableType)
+ Type of "eq" is "_NotImplementedType | Unknown" (reportUnknownVariableType)
+ /tmp/mypy_primer/projects/sympy/sympy/solvers/tests/test_solveset.py:3411:13 - warning: Argument type is Any
+ Argument corresponds to parameter "lhs" in function "__new__" (reportAny)
- /tmp/mypy_primer/projects/sympy/sympy/solvers/tests/test_solveset.py:3513:5 - warning: Type of "e" is partially unknown
- Type of "e" is "ComplexInfinity | Rational | NaN | One | NegativeOne | Zero | Integer | Half | Unknown | Expr" (reportUnknownVariableType)
- Type of "ans" is "set[tuple[Any | Unknown, Any] | tuple[Unknown, Any]]" (reportUnknownVariableType)
+ Type of "ans" is "set[tuple[Any, Any] | tuple[Unknown, Any]]" (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 | Zero | One | Self@Expr | tuple[Unknown, ...] | Sum | Order | NaN | Piecewise | Basic | Equality | Relational | Unequality | ComplexInfinity | Expr | Float | Half | Infinity | Integer | Lambda | NegativeInfinity | NegativeOne | Number | Rational | 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 | Zero | One | Self@Expr | tuple[Unknown, ...] | Sum | Order | NaN | Piecewise | Basic | Equality | Add | ComplexInfinity | Expr | Float | Half | Infinity | Integer | Lambda | NegativeInfinity | NegativeOne | Number | Rational | 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 | Zero | NaN | 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 | Zero | NaN | Piecewise | Equality | Integral | ExpectationMatrix | Literal[0] | None)" (reportUnknownVariableType)
- Type of "H" is "(expr: Unknown, condition: Unknown | None = None, **kwargs: Unknown) -> (int | Expr | Basic | Expectation | Unknown | tuple[Unknown, ...] | Sum | Self@Expr | Order | Any | Zero | NaN | Piecewise | Equality | Relational | Unequality | Integral | ExpectationMatrix | None)" (reportUnknownVariableType)
+ Type of "H" is "(expr: Unknown, condition: Unknown | None = None, **kwargs: Unknown) -> (int | Expr | Basic | Expectation | Unknown | tuple[Unknown, ...] | Sum | Self@Expr | Order | Any | Zero | NaN | Piecewise | Equality | 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 | Zero | NaN | Piecewise | Equality | Relational | Unequality | Integral | ExpectationMatrix | Literal[0] | 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 | Zero | NaN | Piecewise | Equality | Integral | ExpectationMatrix | Literal[0] | None)" (reportUnknownVariableType)
- Type of "entropy" is "(expr: Unknown, condition: Unknown | None = None, **kwargs: Unknown) -> (int | Expr | Basic | Expectation | Unknown | tuple[Unknown, ...] | Sum | Self@Expr | Order | Any | Zero | NaN | Piecewise | Equality | Relational | Unequality | Integral | ExpectationMatrix | None)" (reportUnknownVariableType)
+ Type of "entropy" is "(expr: Unknown, condition: Unknown | None = None, **kwargs: Unknown) -> (int | Expr | Basic | Expectation | Unknown | tuple[Unknown, ...] | Sum | Self@Expr | Order | Any | Zero | NaN | Piecewise | Equality | Integral | ExpectationMatrix | None)" (reportUnknownVariableType)
- Type of "correlation" is "(X: Unknown, Y: Unknown, condition: Unknown | None = None, **kwargs: Unknown) -> (Unknown | Expr | Any | ComplexInfinity | Rational | NaN | One | NegativeOne | Zero | Integer | Half)" (reportUnknownVariableType)
+ Type of "correlation" is "(X: Unknown, Y: Unknown, condition: Unknown | None = None, **kwargs: Unknown) -> (Unknown | Expr | Any | ComplexInfinity | Rational | NaN | One | NegativeOne | Zero | Integer | Half | Infinity | NegativeInfinity | Float | _NotImplementedType)" (reportUnknownVariableType)
- Type of "factorial_moment" is "(X: Unknown, n: Unknown, condition: Unknown | None = None, **kwargs: Unknown) -> (Expr | Basic | Expectation | Unknown | tuple[Unknown, ...] | Sum | Self@Expr | Order | Any | Zero | NaN | Piecewise | Equality | Relational | Unequality | Integral | ExpectationMatrix | Literal[0] | None)" (reportUnknownVariableType)
+ Type of "factorial_moment" is "(X: Unknown, n: Unknown, condition: Unknown | None = None, **kwargs: Unknown) -> (Expr | Basic | Expectation | Unknown | tuple[Unknown, ...] | Sum | Self@Expr | Order | Any | Zero | NaN | Piecewise | Equality | Integral | ExpectationMatrix | Literal[0] | None)" (reportUnknownVariableType)
- Type of "coskewness" is "(X: Unknown, Y: Unknown, Z: Unknown, condition: Unknown | None = None, **kwargs: Unknown) -> (Unknown | Expr | Any | ComplexInfinity | Rational | NaN | One | NegativeOne | Zero | Integer | Half)" (reportUnknownVariableType)
+ Type of "coskewness" is "(X: Unknown, Y: Unknown, Z: Unknown, condition: Unknown | None = None, **kwargs: Unknown) -> (Unknown | Expr | Any | ComplexInfinity | Rational | NaN | One | NegativeOne | Zero | Integer | Half | Infinity | NegativeInfinity | Float | _NotImplementedType)" (reportUnknownVariableType)
- /tmp/mypy_primer/projects/sympy/sympy/stats/compound_rv.py:107:9 - warning: Return type, "tuple[Unknown, ...] | Unknown | Sum | Self@Expr | Order | Any | Zero | NaN | Piecewise | Basic | Equality | Relational | Unequality | Integral | Literal[0] | None", is partially unknown (reportUnknownParameterType)
+ /tmp/mypy_primer/projects/sympy/sympy/stats/compound_rv.py:107:9 - warning: Return type, "tuple[Unknown, ...] | Unknown | Sum | Self@Expr | Order | Any | Zero | NaN | Piecewise | Basic | Equality | Integral | Literal[0] | None", is partially unknown (reportUnknownParameterType)
- Type of "compute_expectation" is "(expr: Unknown, rvs: Unknown | None = None, **kwargs: Unknown) -> (tuple[Unknown, ...] | Unknown | Sum | Self@Expr | Order | Any | Zero | NaN | Piecewise | Basic | Equality | Relational | Unequality | Literal[0] | None)" (reportUnknownMemberType)
+ Type of "compute_expectation" is "(expr: Unknown, rvs: Unknown | None = None, **kwargs: Unknown) -> (tuple[Unknown, ...] | Unknown | Sum | Self@Expr | Order | Any | Zero | NaN | Piecewise | Basic | Equality | Literal[0] | None)" (reportUnknownMemberType)
- /tmp/mypy_primer/projects/sympy/sympy/stats/compound_rv.py:113:20 - warning: Return type, "tuple[Unknown, ...] | Unknown | Sum | Self@Expr | Order | Any | Zero | NaN | Piecewise | Basic | Equality | Relational | Unequality | Literal[0] | None", is partially unknown (reportUnknownVariableType)
... (truncated 4031 lines) ...
nox (https://github.com/wntrblm/nox): 289.81x slower (0.1s -> 15.1s in a single noisy sample)
AutoSplit (https://github.com/Toufool/AutoSplit): 486.68x slower (0.0s -> 16.1s in a single noisy sample)
|
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 #886