Skip to content

Conversation

@DetachHead
Copy link
Owner

fixes #125

@DetachHead DetachHead force-pushed the verifytypes-language-server branch from 8dddb28 to d535210 Compare June 7, 2025 00:46
@github-actions
Copy link
Contributor

github-actions bot commented Jun 7, 2025

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

sympy (https://github.com/sympy/sympy)
-     Type of "_keep_coeff" is "(coeff: Unknown, factors: Unknown, clear: bool = True, sign: bool = False) -> (Unknown | Expr)" (reportUnknownVariableType)
+     Type of "_keep_coeff" is "(coeff: Unknown, factors: Unknown, clear: bool = True, sign: bool = False) -> (Unknown | Add | Expr | Mul)" (reportUnknownVariableType)
-     Type of "factor" is "(f: Unknown, ..., deep: bool = False) -> (Unknown | Expr)" (reportUnknownVariableType)
+     Type of "factor" is "(f: Unknown, ..., deep: bool = False) -> (Unknown | Add | Expr | Mul)" (reportUnknownVariableType)
-     Type of "nthroot" is "(expr: Unknown, n: Unknown, max_len: int = 4, prec: int = 15) -> (Unknown | One | NegativeOne | Zero | Integer | NaN | ComplexInfinity | Rational | NegativeInfinity | Infinity | Float | Number | Expr | Any | Add | None)" (reportUnknownVariableType)
+     Type of "nthroot" is "(expr: Unknown, n: Unknown, max_len: int = 4, prec: int = 15) -> (Unknown | One | NegativeOne | Zero | Integer | NaN | ComplexInfinity | Rational | NegativeInfinity | Infinity | Float | Number | Expr | Any | Mul | Add | None)" (reportUnknownVariableType)
+   ...:248:20 - warning: Argument type is unknown
+     Argument corresponds to parameter "expr" in function "nthroot" (reportUnknownArgumentType)
-   ...:263:5 - warning: Type of "q" is partially unknown
-     Type of "q" is "Expr | Unknown" (reportUnknownVariableType)
-   ...:264:5 - warning: Type of "p" is partially unknown
-     Type of "p" is "Unknown | Expr | Any" (reportUnknownVariableType)
-   ...:266:5 - warning: Type of "q" is partially unknown
-   ...:267:5 - warning: Type of "p" is partially unknown
-     Type of "p" is "Unknown | Expr | Any" (reportUnknownVariableType)
+   ...:254:39 - warning: Argument type is unknown
+     Argument corresponds to parameter "expr" in function "nthroot" (reportUnknownArgumentType)
+   ...:256:20 - warning: Argument type is unknown
+     Argument corresponds to parameter "expr" in function "nthroot" (reportUnknownArgumentType)
+   ...:258:20 - warning: Argument type is unknown
+     Argument corresponds to parameter "expr" in function "nthroot" (reportUnknownArgumentType)
+   ...:259:20 - warning: Argument type is unknown
+     Argument corresponds to parameter "expr" in function "nthroot" (reportUnknownArgumentType)
+   ...:264:5 - warning: Type of "p" is unknown (reportUnknownVariableType)
+   ...:265:20 - warning: Argument type is unknown
+     Argument corresponds to parameter "expr" in function "nthroot" (reportUnknownArgumentType)
+   ...:267:5 - warning: Type of "p" is unknown (reportUnknownVariableType)
+   ...:268:20 - warning: Argument type is unknown
+     Argument corresponds to parameter "expr" in function "nthroot" (reportUnknownArgumentType)
-   ...:752:19 - warning: Argument type is unknown
-     Argument corresponds to parameter "f" in function "cancel" (reportUnknownArgumentType)
-   ...:755:21 - warning: Argument type is unknown
-     Argument corresponds to parameter "expr" in function "simplify" (reportUnknownArgumentType)
-     Type of "quadratic" is "Any | Expr | Unknown" (reportUnknownVariableType)
+     Type of "quadratic" is "Any | Unknown | Expr | MatMul" (reportUnknownVariableType)
-     Type of "as_explicit" is "Any | Unknown" (reportUnknownMemberType)
+     Type of "as_explicit" is "Any | Unknown | (() -> ImmutableDenseMatrix)" (reportUnknownMemberType)
-   ...:836:9 - warning: Return type, "MatrixSymbol | MatPow | Unknown", is partially unknown (reportUnknownParameterType)
+   ...:836:9 - warning: Return type, "MatrixSymbol | Unknown | Basic | Identity | Inverse | Any | MatPow", is partially unknown (reportUnknownParameterType)
+   ...:840:20 - warning: Return type, "Unknown | Basic | Identity | Inverse | Any | MatPow", is partially unknown (reportUnknownVariableType)
-     Type of "m_simp" is "Unknown | Basic | Identity | Inverse | Any | MatPow | MatrixSymbol" (reportUnknownVariableType)
+     Type of "m_simp" is "Inverse | Unknown | Basic | Identity | Any | MatrixSymbol" (reportUnknownVariableType)
-     Type of "doit" is "((**hints: Unknown) -> MatrixSymbol) | ((**hints: Unknown) -> (Unknown | Basic | Identity | Inverse | Any | MatPow)) | Unknown" (reportUnknownMemberType)
+     Type of "doit" is "((**hints: Unknown) -> MatrixSymbol) | Unknown | ((**hints: Unknown) -> Basic) | ((**hints: Unknown) -> Identity) | ((**hints: Unknown) -> (Inverse | Unknown)) | Any | ((**hints: Unknown) -> (Unknown | Basic | Identity | Inverse | Any))" (reportUnknownMemberType)
-     Argument type is "NaN | Infinity | NegativeInfinity | Unknown" (reportUnknownArgumentType)
+     Argument type is "NaN | Infinity | NegativeInfinity | _NotImplementedType | Expr | Unknown" (reportUnknownArgumentType)
+   ...:123:5 - warning: Type of "z1" is unknown (reportUnknownVariableType)
-   ...:123:5 - warning: Type of "z1" is partially unknown
-     Type of "z1" is "Unknown | Expr | Any" (reportUnknownVariableType)
+   ...:200:5 - warning: Type of "d2" is partially unknown
+     Type of "d2" is "One | NegativeOne | Zero | Integer | NaN | ComplexInfinity | Rational | Infinity | NegativeInfinity | Float | Number | Expr | Unknown" (reportUnknownVariableType)
-   ...:200:5 - warning: Type of "d2" is unknown (reportUnknownVariableType)
-   ...:202:42 - warning: Argument type is unknown
-     Argument corresponds to parameter "d2" in function "_sqrt_numeric_denest" (reportUnknownArgumentType)
-     Type of "trigsimp" is "(expr: Unknown, inverse: bool = False, **opts: Unknown) -> (Any | Unknown | Expr | Basic | atan2 | ComplexInfinity)" (reportUnknownVariableType)
+     Type of "trigsimp" is "(expr: Unknown, inverse: bool = False, **opts: Unknown) -> (Any | Unknown | Expr | Basic | atan2 | ComplexInfinity | NaN | Rational | Zero | Infinity | NegativeInfinity | Float | _NotImplementedType)" (reportUnknownVariableType)
-   ...:93:16 - error: Operator "-" not supported for types "Any | Unknown | Expr | Basic | atan2 | ComplexInfinity" and "float"
+   ...:93:16 - error: Operator "-" not supported for types "Any | Unknown | Expr | Basic | atan2 | ComplexInfinity | NaN | Rational | Zero | Infinity | NegativeInfinity | Float | _NotImplementedType" and "float"
-     Argument type is "Any | Unknown | Expr" (reportUnknownArgumentType)
+     Argument type is "Any | Unknown | Expr | NaN | ComplexInfinity | Rational | Zero | Infinity | NegativeInfinity | Float | Number | One | NegativeOne | Integer" (reportUnknownArgumentType)
-     Type of "trigsimp" is "(**args: Unknown) -> (Any | Unknown | Expr | Basic | atan2 | ComplexInfinity)" (reportUnknownMemberType)
+     Type of "trigsimp" is "(**args: Unknown) -> (Any | Unknown | Expr | Basic | atan2 | ComplexInfinity | NaN | Rational | Zero | Infinity | NegativeInfinity | Float | _NotImplementedType)" (reportUnknownMemberType)
-     Type of "factor" is "(...) -> (Unknown | Expr)" (reportUnknownMemberType)
+     Type of "factor" is "(...) -> (Unknown | Add | Expr | Mul)" (reportUnknownMemberType)
-   ...:307:16 - error: Operator "-" not supported for types "Any | Unknown | Expr | Basic | atan2 | ComplexInfinity" and "float"
+   ...:307:16 - error: Operator "-" not supported for types "Any | Unknown | Expr | Basic | atan2 | ComplexInfinity | NaN | Rational | Zero | Infinity | NegativeInfinity | Float | _NotImplementedType" and "float"
-     Argument type is "Any | Unknown | Expr" (reportUnknownArgumentType)
+     Argument type is "Any | Unknown | Expr | NaN | ComplexInfinity | Rational | Zero | Infinity | NegativeInfinity | Float | Number | One | NegativeOne | Integer" (reportUnknownArgumentType)
-     Type of "angle_inverted" is "Any | Unknown | Expr | Basic | atan2 | ComplexInfinity" (reportUnknownVariableType)
+     Type of "angle_inverted" is "Any | Unknown | Expr | Basic | atan2 | ComplexInfinity | NaN | Rational | Zero | Infinity | NegativeInfinity | Float | _NotImplementedType" (reportUnknownVariableType)
-     Type of "decompogen" is "(f: Unknown, symbol: Unknown) -> (list[Expr] | list[Function | Pow] | list[Expr | Basic] | list[Function | Pow | Basic] | Unknown | list[Min | Max | Basic] | list[Unknown | Max | Min | Basic] | list[Basic] | list[Min | Max] | list[Unknown | Max | Min] | list[Unknown])" (reportUnknownVariableType)
+     Type of "decompogen" is "(f: Unknown, symbol: Unknown) -> (list[Expr] | list[Function | Pow] | list[Expr | Basic] | list[Function | Pow | Basic] | Unknown | list[Min | Max | Basic] | list[Unknown | Max | Min | Basic] | list[Basic] | list[Expr | Unknown | Basic] | list[Unknown | Poly | Basic] | list[Min | Max] | list[Unknown | Max | Min] | list[Expr | Unknown] | list[Unknown | Poly])" (reportUnknownVariableType)
-     Type of "nonlinsolve" is "(system: Unknown, *symbols: Unknown) -> (Unknown | FiniteSet | Set | Union | Intersection)" (reportUnknownVariableType)
+     Type of "nonlinsolve" is "(system: Unknown, *symbols: Unknown) -> (Unknown | FiniteSet | Set | Union | Intersection | Complement | ConditionSet)" (reportUnknownVariableType)
-     Type of "substitution" is "(system: Unknown, symbols: Unknown, result: Unknown = [{}], known_symbols: Unknown = [], exclude: Unknown = [], all_symbols: Unknown | None = None) -> (Unknown | Set | FiniteSet | Union | Intersection)" (reportUnknownVariableType)
+     Type of "substitution" is "(system: Unknown, symbols: Unknown, result: Unknown = [{}], known_symbols: Unknown = [], exclude: Unknown = [], all_symbols: Unknown | None = None) -> (Unknown | Set | FiniteSet | Union | Intersection | Complement | ConditionSet)" (reportUnknownVariableType)
-     Type of "factor" is "(f: Unknown, ..., deep: bool = False) -> (Unknown | Expr)" (reportUnknownVariableType)
+     Type of "factor" is "(f: Unknown, ..., deep: bool = False) -> (Unknown | Add | Expr | Mul)" (reportUnknownVariableType)
-   ...:460:9 - warning: Type of "f" is partially unknown
-     Type of "f" is "Unknown | Expr" (reportUnknownVariableType)

... (truncated 11911 lines) ...

@DetachHead DetachHead marked this pull request as ready for review June 11, 2025 14:06
@DetachHead DetachHead marked this pull request as draft June 11, 2025 14:07
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.

--verifytypes should be run as part of the normal type checker

2 participants