Open
Conversation
…tors Updated isMaybeDescriptorInstance to use lookUpObjectMember for MRO-aware lookup of __get__ and __set__ methods, fixing all ~6 call sites that were broken for descriptor subclasses. Simplified typeGuards.ts to use the fixed utility function instead of custom MRO lookup logic.
Contributor
|
Diff from mypy_primer, showing the effect of this PR on open source code: sympy (https://github.com/sympy/sympy)
- .../projects/sympy/sympy/solvers/diophantine/diophantine.py:176:44 - error: Cannot access attribute "expand" for class "Basic"
- Attribute "expand" is unknown (reportAttributeAccessIssue)
- .../projects/sympy/sympy/solvers/diophantine/tests/test_diophantine.py:314:30 - error: Cannot access attribute "as_independent" for class "Basic"
- Attribute "as_independent" is unknown (reportAttributeAccessIssue)
- .../projects/sympy/sympy/solvers/diophantine/tests/test_diophantine.py:383:30 - error: Cannot access attribute "as_independent" for class "Basic"
- Attribute "as_independent" is unknown (reportAttributeAccessIssue)
+ .../projects/sympy/sympy/solvers/ode/single.py:867:9 - error: Expression with type "tuple[ComplexInfinity | NaN | Rational | Zero | Infinity | NegativeInfinity | Float | NotImplementedType | Expr | Unknown | Any, list[tuple[Unknown, Unknown]] | list[Unknown]] | tuple[ComplexInfinity | NaN | Rational | Zero | Infinity | NegativeInfinity | Float | NotImplementedType | Expr | Unknown | Any, list[tuple[Unknown, Unknown]] | list[Unknown], list[tuple[Unknown, Unknown]] | list[Unknown]]" cannot be assigned to target tuple
+ Type "tuple[ComplexInfinity | NaN | Rational | Zero | Infinity | NegativeInfinity | Float | NotImplementedType | Expr | Unknown | Any, list[tuple[Unknown, Unknown]] | list[Unknown], list[tuple[Unknown, Unknown]] | list[Unknown]]" is incompatible with target tuple
+ Tuple size mismatch; expected 2 but received 3 (reportAssignmentType)
- .../projects/sympy/sympy/solvers/ode/systems.py:1214:26 - error: Argument of type "dict[str, str | Unknown | Pow | bool | Symbol]" cannot be assigned to parameter "m" of type "Iterable[tuple[str, str]]" in function "update"
+ .../projects/sympy/sympy/solvers/ode/systems.py:1214:26 - error: Argument of type "dict[str, str | Unknown | Expr | bool | Symbol]" cannot be assigned to parameter "m" of type "Iterable[tuple[str, str]]" in function "update"
- .../projects/sympy/sympy/vector/implicitregion.py:188:18 - error: Operator "/" not supported for types "int | Unknown" and "Alg | Unknown | GaussianRational | MPQ | GaussianInteger | MPZ | Expr | Rational | NaN | ComplexInfinity | One | NegativeOne | Zero | Integer | Infinity | NegativeInfinity | Float | Number | Poly | Any"
- Operator "/" not supported for types "int" and "MPZ" (reportOperatorIssue)
- .../projects/sympy/sympy/vector/implicitregion.py:189:18 - error: Operator "/" not supported for types "int | Unknown" and "Alg | Unknown | GaussianRational | MPQ | GaussianInteger | MPZ | Expr | Rational | NaN | ComplexInfinity | One | NegativeOne | Zero | Integer | Infinity | NegativeInfinity | Float | Number | Poly | Any"
- Operator "/" not supported for types "int" and "MPZ" (reportOperatorIssue)
- .../projects/sympy/sympy/vector/implicitregion.py:190:18 - error: Operator "/" not supported for types "int | Unknown" and "Alg | Unknown | GaussianRational | MPQ | GaussianInteger | MPZ | Expr | Rational | NaN | ComplexInfinity | One | NegativeOne | Zero | Integer | Infinity | NegativeInfinity | Float | Number | Poly | Any"
- Operator "/" not supported for types "int" and "MPZ" (reportOperatorIssue)
- .../projects/sympy/sympy/vector/implicitregion.py:206:18 - error: Operator "*" not supported for types "Unknown | Expr | Any" and "Alg | Unknown | GaussianRational | MPQ | GaussianInteger | MPZ | Expr | Rational | NaN | ComplexInfinity | One | NegativeOne | Zero | Integer | Infinity | NegativeInfinity | Float | Number | Poly | Any"
- Operator "*" not supported for types "Expr" and "GaussianRational"
- Operator "*" not supported for types "Expr" and "MPQ"
- Operator "*" not supported for types "Expr" and "GaussianInteger"
- Operator "*" not supported for types "Expr" and "MPZ" (reportOperatorIssue)
- .../projects/sympy/sympy/vector/implicitregion.py:210:18 - error: Operator "*" not supported for types "Unknown | Expr | Any" and "Alg | Unknown | GaussianRational | MPQ | GaussianInteger | MPZ | Expr | Rational | NaN | ComplexInfinity | One | NegativeOne | Zero | Integer | Infinity | NegativeInfinity | Float | Number | Poly | Any"
- Operator "*" not supported for types "Expr" and "GaussianRational"
- Operator "*" not supported for types "Expr" and "MPQ"
- Operator "*" not supported for types "Expr" and "GaussianInteger"
- Operator "*" not supported for types "Expr" and "MPZ" (reportOperatorIssue)
- .../projects/sympy/sympy/vector/implicitregion.py:214:18 - error: Operator "*" not supported for types "Unknown | Expr | Any" and "Alg | Unknown | GaussianRational | MPQ | GaussianInteger | MPZ | Expr | Rational | NaN | ComplexInfinity | One | NegativeOne | Zero | Integer | Infinity | NegativeInfinity | Float | Number | Poly | Any"
- Operator "*" not supported for types "Expr" and "GaussianRational"
- Operator "*" not supported for types "Expr" and "MPQ"
- Operator "*" not supported for types "Expr" and "GaussianInteger"
- Operator "*" not supported for types "Expr" and "MPZ" (reportOperatorIssue)
- 38415 errors, 84 warnings, 0 informations
+ 38407 errors, 84 warnings, 0 informations
|
This file contains hidden or 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
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.
Fix isMaybeDescriptorInstance to use MRO lookup for inherited descriptors
Updated isMaybeDescriptorInstance to use lookUpObjectMember for MRO-aware lookup of get and set methods, fixing all ~6 call sites that were broken for descriptor subclasses. Simplified typeGuards.ts to use the fixed utility function instead of custom MRO lookup logic.
Fixes #11039