-
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
remove incorrect diagnostic for invalid python identifier in dataclass field aliases and prevent them from appearing in completions #838
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
…ias names because it's allowed in pydantic
This comment has been minimized.
This comment has been minimized.
DetachHead
changed the title
remove diagnostic for invalid python identifier in dataclass field aliases and prevent them from appearing in completions
remove incorrect diagnostic for invalid python identifier in dataclass field aliases and prevent them from appearing in completions
Nov 1, 2024
Diff from mypy_primer, showing the effect of this PR on open source code: sympy (https://github.com/sympy/sympy)
- /tmp/mypy_primer/projects/sympy/sympy/stats/compound_rv.py:107:9 - warning: Return type, "tuple[Unknown, ...] | Unknown | Self@Sum | Self@Expr | Order | Any | Piecewise | Basic | Equality | Relational | Unequality | Sum | Integral | 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 | Piecewise | Basic | Equality | Relational | Unequality | Integral | None", is partially unknown (reportUnknownParameterType)
- Type of "compute_expectation" is "(expr: Unknown, rvs: Unknown | None = None, **kwargs: Unknown) -> (tuple[Unknown, ...] | Unknown | Self@Sum | Self@Expr | Order | Any | Piecewise | Basic | Equality | Relational | Unequality | Sum | None)" (reportUnknownMemberType)
+ Type of "compute_expectation" is "(expr: Unknown, rvs: Unknown | None = None, **kwargs: Unknown) -> (tuple[Unknown, ...] | Unknown | Sum | Self@Expr | Order | Any | Piecewise | Basic | Equality | Relational | Unequality | None)" (reportUnknownMemberType)
- /tmp/mypy_primer/projects/sympy/sympy/stats/compound_rv.py:113:20 - warning: Return type, "tuple[Unknown, ...] | Unknown | Self@Sum | Self@Expr | Order | Any | Piecewise | Basic | Equality | Relational | Unequality | Sum | None", is partially unknown (reportUnknownVariableType)
+ /tmp/mypy_primer/projects/sympy/sympy/stats/compound_rv.py:113:20 - warning: Return type, "tuple[Unknown, ...] | Unknown | Sum | Self@Expr | Order | Any | Piecewise | Basic | Equality | Relational | Unequality | None", is partially unknown (reportUnknownVariableType)
- Type of "doit" is "((**hints: Unknown) -> Equality) | Unknown | ((**hints: Unknown) -> Relational) | ((**hints: Unknown) -> Unequality) | ((**hints: Unknown) -> (tuple[Unknown, ...] | Unknown | Sum | Self@Expr | Order | Any | Piecewise | Basic | Equality | Relational | Unequality | None)) | ((**hints: Unknown) -> Unknown)" (reportUnknownMemberType)
+ Type of "doit" is "((**hints: Unknown) -> Equality) | Unknown | ((**hints: Unknown) -> Relational) | ((**hints: Unknown) -> Unequality) | ((**hints: Unknown) -> (tuple[Unknown, ...] | Unknown | Sum | Self@Expr | Order | Any | Piecewise | Basic | None)) | ((**hints: Unknown) -> Unknown)" (reportUnknownMemberType)
- Type of "summation" is "(f: Unknown, ...) -> (Equality | Relational | Unequality | Unknown)" (reportUnknownVariableType)
+ Type of "summation" is "(f: Unknown, ...) -> (tuple[Unknown, ...] | Unknown | Self@Sum | Self@Expr | Order | Any | Piecewise | Basic | Equality | Relational | Unequality | None)" (reportUnknownVariableType)
- Type of "density" is "(expr: Unknown, condition: Unknown | None = None, evaluate: bool = True, numsamples: Unknown | None = None, **kwargs: Unknown) -> (dict[Unknown, Unknown] | Density | Lambda | Basic | Any | Unknown | FiniteDensity | None)" (reportUnknownVariableType)
+ Type of "density" is "(expr: Unknown, condition: Unknown | None = None, evaluate: bool = True, numsamples: Unknown | None = None, **kwargs: Unknown) -> Unknown" (reportUnknownVariableType)
- /tmp/mypy_primer/projects/sympy/sympy/stats/drv.py:242:13 - warning: Type of "dens" is partially unknown
+ /tmp/mypy_primer/projects/sympy/sympy/stats/drv.py:242:13 - warning: Type of "dens" is unknown (reportUnknownVariableType)
- Type of "dens" is "dict[Unknown, Unknown] | Density | Lambda | Basic | Any | Unknown | FiniteDensity | None" (reportUnknownVariableType)
+ /tmp/mypy_primer/projects/sympy/sympy/stats/drv.py:245:53 - warning: Argument type is unknown
+ Argument corresponds to parameter "pdf" in function "__new__" (reportUnknownArgumentType)
- Type of "doit" is "Unknown | ((**hints: Unknown) -> (tuple[Unknown, ...] | Unknown | Sum | Self@Expr | Order | Any | Piecewise | Basic | Equality | Relational | Unequality | None)) | ((**hints: Unknown) -> Self@Expr) | ((**hints: Unknown) -> Order) | Any | ((**hints: Unknown) -> Piecewise) | ((**hints: Unknown) -> Basic) | ((**hints: Unknown) -> Equality) | ((**hints: Unknown) -> Relational) | ((**hints: Unknown) -> Unequality)" (reportUnknownMemberType)
+ Type of "doit" is "Unknown | ((**hints: Unknown) -> (tuple[Unknown, ...] | Unknown | Sum | Self@Expr | Order | Any | Piecewise | Basic | None)) | ((**hints: Unknown) -> Self@Expr) | ((**hints: Unknown) -> Order) | Any | ((**hints: Unknown) -> Piecewise) | ((**hints: Unknown) -> Basic) | ((**hints: Unknown) -> Equality) | ((**hints: Unknown) -> Relational) | ((**hints: Unknown) -> Unequality)" (reportUnknownMemberType)
- Type of "probability" is "(condition: Unknown) -> Unknown" (reportUnknownMemberType)
+ Type of "probability" is "(condition: Unknown) -> (Unknown | Probability | Self@Expr | tuple[Unknown, ...] | Sum | Order | Any | Piecewise | Basic | Equality | Relational | Unequality | int)" (reportUnknownMemberType)
- Type of "doit" is "((**hints: Unknown) -> Equality) | Unknown | ((**hints: Unknown) -> Relational) | ((**hints: Unknown) -> Unequality) | ((**hints: Unknown) -> (tuple[Unknown, ...] | Unknown | Sum | Self@Expr | Order | Any | Piecewise | Basic | Equality | Relational | Unequality | None))" (reportUnknownMemberType)
+ Type of "doit" is "((**hints: Unknown) -> Equality) | Unknown | ((**hints: Unknown) -> Relational) | ((**hints: Unknown) -> Unequality) | ((**hints: Unknown) -> (tuple[Unknown, ...] | Unknown | Sum | Self@Expr | Order | Any | Piecewise | Basic | None))" (reportUnknownMemberType)
- Type of "doit" is "((**hints: Unknown) -> Equality) | Unknown | ((**hints: Unknown) -> Relational) | ((**hints: Unknown) -> Unequality) | ((**hints: Unknown) -> (tuple[Unknown, ...] | Unknown | Sum | Self@Expr | Order | Any | Piecewise | Basic | Equality | Relational | Unequality | None))" (reportUnknownMemberType)
+ Type of "doit" is "((**hints: Unknown) -> Equality) | Unknown | ((**hints: Unknown) -> Relational) | ((**hints: Unknown) -> Unequality) | ((**hints: Unknown) -> (tuple[Unknown, ...] | Unknown | Sum | Self@Expr | Order | Any | Piecewise | Basic | None))" (reportUnknownMemberType)
- /tmp/mypy_primer/projects/sympy/sympy/stats/frv.py:443:9 - warning: Return type, "tuple[Unknown, ...] | Unknown | Self@Sum | Self@Expr | Order | Any | Piecewise | Basic | Equality | Relational | Unequality | Sum | None", is partially unknown (reportUnknownParameterType)
+ /tmp/mypy_primer/projects/sympy/sympy/stats/frv.py:443:9 - warning: Return type, "tuple[Unknown, ...] | Unknown | Sum | Self@Expr | Order | Any | Piecewise | Basic | Equality | Relational | Unequality | None", is partially unknown (reportUnknownParameterType)
- Type of "doit" is "((**hints: Unknown) -> Equality) | Unknown | ((**hints: Unknown) -> Relational) | ((**hints: Unknown) -> Unequality) | ((**hints: Unknown) -> (tuple[Unknown, ...] | Unknown | Self@Sum | Self@Expr | Order | Any | Piecewise | Basic | Equality | Relational | Unequality | Sum | None))" (reportUnknownMemberType)
+ Type of "doit" is "((**hints: Unknown) -> Equality) | Unknown | ((**hints: Unknown) -> Relational) | ((**hints: Unknown) -> Unequality) | ((**hints: Unknown) -> (tuple[Unknown, ...] | Unknown | Sum | Self@Expr | Order | Any | Piecewise | Basic | None))" (reportUnknownMemberType)
- /tmp/mypy_primer/projects/sympy/sympy/stats/frv.py:451:20 - warning: Return type, "tuple[Unknown, ...] | Unknown | Self@Sum | Self@Expr | Order | Any | Piecewise | Basic | Equality | Relational | Unequality | Sum | None", is partially unknown (reportUnknownVariableType)
+ /tmp/mypy_primer/projects/sympy/sympy/stats/frv.py:451:20 - warning: Return type, "tuple[Unknown, ...] | Unknown | Sum | Self@Expr | Order | Any | Piecewise | Basic | Equality | Relational | Unequality | None", is partially unknown (reportUnknownVariableType)
- /tmp/mypy_primer/projects/sympy/sympy/stats/frv_types.py:236:16 - error: Operator "&" not supported for types "_NotImplementedType | GreaterThan | Unknown | Equality | Relational | Unequality" and "_NotImplementedType | LessThan | Unknown | Equality | Relational | Unequality"
- Operator "&" not supported for types "GreaterThan" and "LessThan"
- Operator "&" not supported for types "GreaterThan" and "Equality"
- Operator "&" not supported for types "GreaterThan" and "Relational"
- Operator "&" not supported for types "GreaterThan" and "Unequality"
- Operator "&" not supported for types "Equality" and "LessThan"
- Operator "&" not supported for types "Equality" and "Equality"
- Operator "&" not supported for types "Equality" and "Relational"
- Operator "&" not supported for types "Equality" and "Unequality"
- ... (reportOperatorIssue)
- /tmp/mypy_primer/projects/sympy/sympy/stats/frv_types.py:425:16 - error: Operator "&" not supported for types "_NotImplementedType | GreaterThan | Unknown | Equality | Relational | Unequality" and "_NotImplementedType | LessThan | Unknown | Equality | Relational | Unequality"
- Operator "&" not supported for types "GreaterThan" and "LessThan"
- Operator "&" not supported for types "GreaterThan" and "Equality"
- Operator "&" not supported for types "GreaterThan" and "Relational"
- Operator "&" not supported for types "GreaterThan" and "Unequality"
- Operator "&" not supported for types "Equality" and "LessThan"
- Operator "&" not supported for types "Equality" and "Equality"
- Operator "&" not supported for types "Equality" and "Relational"
- Operator "&" not supported for types "Equality" and "Unequality"
- ... (reportOperatorIssue)
- /tmp/mypy_primer/projects/sympy/sympy/stats/frv_types.py:713:17 - error: Operator "&" not supported for types "_NotImplementedType | GreaterThan | Unknown | Equality | Relational | Unequality" and "_NotImplementedType | LessThan | Unknown | Equality | Relational | Unequality"
... (truncated 409 lines) ...
asynq (https://github.com/quora/asynq): 212.37x slower (0.1s -> 13.1s in a single noisy sample)
|
Closed
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 #837