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

Pull Pylance with Pyright 1.1.393 #9788

Merged
merged 1 commit into from
Jan 29, 2025

Conversation

bschnurr
Copy link
Member

@bschnurr bschnurr commented Jan 29, 2025

changes included:

  1. localization changes
  2. added some helper functions
  3. added new test consts

Copy link
Contributor

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/tensor/array/tests/test_arrayop.py:140:59 - error: Cannot access attribute "tomatrix" for class "ArrayTensorProduct"
+     Attribute "tomatrix" is unknown (reportAttributeAccessIssue)
-   /tmp/mypy_primer/projects/sympy/sympy/tensor/array/tests/test_arrayop.py:157:49 - error: Argument of type "One | NDimArray | ImmutableDenseNDimArray | Unknown | Zero | ZeroArray | ArrayContraction | Basic | PermuteDims | ArrayTensorProduct | ImmutableSparseNDimArray* | ImmutableDenseNDimArray* | ImmutableSparseNDimArray" cannot be assigned to parameter "stop" of type "SupportsIndex" in function "__new__"
-     Type "One | NDimArray | ImmutableDenseNDimArray | Unknown | Zero | ZeroArray | ArrayContraction | Basic | PermuteDims | ArrayTensorProduct | ImmutableSparseNDimArray* | ImmutableDenseNDimArray* | ImmutableSparseNDimArray" is not assignable to type "SupportsIndex"
+   /tmp/mypy_primer/projects/sympy/sympy/tensor/array/tests/test_arrayop.py:157:49 - error: Argument of type "One | NDimArray | ImmutableDenseNDimArray | Unknown | Zero | ZeroArray | ArrayTensorProduct | ImmutableSparseNDimArray* | ImmutableDenseNDimArray* | ImmutableSparseNDimArray" cannot be assigned to parameter "stop" of type "SupportsIndex" in function "__new__"
+     Type "One | NDimArray | ImmutableDenseNDimArray | Unknown | Zero | ZeroArray | ArrayTensorProduct | ImmutableSparseNDimArray* | ImmutableDenseNDimArray* | ImmutableSparseNDimArray" is not assignable to type "SupportsIndex"
-       "Basic" is incompatible with protocol "SupportsIndex"
+       "ArrayTensorProduct" is incompatible with protocol "SupportsIndex"
+   /tmp/mypy_primer/projects/sympy/sympy/tensor/array/tests/test_arrayop.py:311:16 - error: "__getitem__" method not defined on type "ArrayTensorProduct" (reportIndexIssue)
+   /tmp/mypy_primer/projects/sympy/sympy/tensor/array/tests/test_arrayop.py:315:16 - error: "__getitem__" method not defined on type "ArrayTensorProduct" (reportIndexIssue)
-     Attribute "reshape" is unknown (reportAttributeAccessIssue)
-   /tmp/mypy_primer/projects/sympy/sympy/tensor/array/tests/test_arrayop.py:361:53 - error: Cannot access attribute "reshape" for class "ArrayContraction"
-     Attribute "reshape" is unknown (reportAttributeAccessIssue)
-   /tmp/mypy_primer/projects/sympy/sympy/tensor/array/tests/test_arrayop.py:361:53 - error: Cannot access attribute "reshape" for class "Basic"
-     Attribute "reshape" is unknown (reportAttributeAccessIssue)
-   /tmp/mypy_primer/projects/sympy/sympy/tensor/array/tests/test_arrayop.py:361:53 - error: Cannot access attribute "reshape" for class "PermuteDims"
+   /tmp/mypy_primer/projects/sympy/sympy/tensor/tests/test_indexed.py:358:36 - error: Cannot access attribute "diff" for class "Relational"
+     Attribute "diff" is unknown (reportAttributeAccessIssue)
+   /tmp/mypy_primer/projects/sympy/sympy/tensor/tests/test_indexed.py:358:36 - error: Cannot access attribute "diff" for class "Unequality"
+     Attribute "diff" is unknown (reportAttributeAccessIssue)
+     Attribute "diff" is unknown (reportAttributeAccessIssue)
+   /tmp/mypy_primer/projects/sympy/sympy/tensor/tests/test_indexed.py:360:36 - error: Cannot access attribute "diff" for class "Relational"
+     Attribute "diff" is unknown (reportAttributeAccessIssue)
+   /tmp/mypy_primer/projects/sympy/sympy/tensor/tests/test_indexed.py:360:36 - error: Cannot access attribute "diff" for class "Unequality"
+   /tmp/mypy_primer/projects/sympy/sympy/tensor/tests/test_indexed.py:363:36 - error: Cannot access attribute "diff" for class "Relational"
+     Attribute "diff" is unknown (reportAttributeAccessIssue)
+   /tmp/mypy_primer/projects/sympy/sympy/tensor/tests/test_indexed.py:363:36 - error: Cannot access attribute "diff" for class "Unequality"
+     Attribute "diff" is unknown (reportAttributeAccessIssue)
+     Attribute "diff" is unknown (reportAttributeAccessIssue)
+   /tmp/mypy_primer/projects/sympy/sympy/tensor/tests/test_indexed.py:370:36 - error: Cannot access attribute "diff" for class "Relational"
+     Attribute "diff" is unknown (reportAttributeAccessIssue)
+   /tmp/mypy_primer/projects/sympy/sympy/tensor/tests/test_indexed.py:370:36 - error: Cannot access attribute "diff" for class "Unequality"
+   /tmp/mypy_primer/projects/sympy/sympy/tensor/tests/test_indexed.py:372:36 - error: Cannot access attribute "diff" for class "Relational"
+     Attribute "diff" is unknown (reportAttributeAccessIssue)
+   /tmp/mypy_primer/projects/sympy/sympy/tensor/tests/test_indexed.py:372:36 - error: Cannot access attribute "diff" for class "Unequality"
+     Attribute "diff" is unknown (reportAttributeAccessIssue)
+     Attribute "diff" is unknown (reportAttributeAccessIssue)
+   /tmp/mypy_primer/projects/sympy/sympy/tensor/tests/test_indexed.py:374:36 - error: Cannot access attribute "diff" for class "Relational"
+     Attribute "diff" is unknown (reportAttributeAccessIssue)
+   /tmp/mypy_primer/projects/sympy/sympy/tensor/tests/test_indexed.py:374:36 - error: Cannot access attribute "diff" for class "Unequality"
+   /tmp/mypy_primer/projects/sympy/sympy/tensor/tests/test_indexed.py:376:36 - error: Cannot access attribute "diff" for class "Relational"
+     Attribute "diff" is unknown (reportAttributeAccessIssue)
+   /tmp/mypy_primer/projects/sympy/sympy/tensor/tests/test_indexed.py:376:36 - error: Cannot access attribute "diff" for class "Unequality"
+     Attribute "diff" is unknown (reportAttributeAccessIssue)
+     Attribute "diff" is unknown (reportAttributeAccessIssue)
+   /tmp/mypy_primer/projects/sympy/sympy/tensor/tests/test_indexed.py:389:36 - error: Cannot access attribute "diff" for class "Relational"
+     Attribute "diff" is unknown (reportAttributeAccessIssue)
+   /tmp/mypy_primer/projects/sympy/sympy/tensor/tests/test_indexed.py:389:36 - error: Cannot access attribute "diff" for class "Unequality"
+   /tmp/mypy_primer/projects/sympy/sympy/tensor/tests/test_indexed.py:390:36 - error: Cannot access attribute "diff" for class "Relational"
+     Attribute "diff" is unknown (reportAttributeAccessIssue)
+   /tmp/mypy_primer/projects/sympy/sympy/tensor/tests/test_indexed.py:390:36 - error: Cannot access attribute "diff" for class "Unequality"
+     Attribute "diff" is unknown (reportAttributeAccessIssue)
+     Attribute "diff" is unknown (reportAttributeAccessIssue)
+   /tmp/mypy_primer/projects/sympy/sympy/tensor/tests/test_indexed.py:394:38 - error: Cannot access attribute "diff" for class "Relational"
+     Attribute "diff" is unknown (reportAttributeAccessIssue)
+   /tmp/mypy_primer/projects/sympy/sympy/tensor/tests/test_indexed.py:394:38 - error: Cannot access attribute "diff" for class "Unequality"
+   /tmp/mypy_primer/projects/sympy/sympy/tensor/tests/test_indexed.py:395:38 - error: Cannot access attribute "diff" for class "Relational"
+     Attribute "diff" is unknown (reportAttributeAccessIssue)
+   /tmp/mypy_primer/projects/sympy/sympy/tensor/tests/test_indexed.py:395:38 - error: Cannot access attribute "diff" for class "Unequality"
+     Attribute "diff" is unknown (reportAttributeAccessIssue)
+   /tmp/mypy_primer/projects/sympy/sympy/tensor/tests/test_indexed.py:396:38 - error: Cannot access attribute "diff" for class "Relational"
+     Attribute "diff" is unknown (reportAttributeAccessIssue)
+   /tmp/mypy_primer/projects/sympy/sympy/tensor/tests/test_indexed.py:396:38 - error: Cannot access attribute "diff" for class "Unequality"
+     Attribute "diff" is unknown (reportAttributeAccessIssue)
+     Attribute "diff" is unknown (reportAttributeAccessIssue)
+   /tmp/mypy_primer/projects/sympy/sympy/tensor/tests/test_indexed.py:397:38 - error: Cannot access attribute "diff" for class "Relational"
+     Attribute "diff" is unknown (reportAttributeAccessIssue)
+   /tmp/mypy_primer/projects/sympy/sympy/tensor/tests/test_indexed.py:397:38 - error: Cannot access attribute "diff" for class "Unequality"
-   /tmp/mypy_primer/projects/sympy/sympy/tensor/tests/test_tensor.py:554:13 - error: Cannot access attribute "canon_bp" for class "One"
-     Attribute "canon_bp" is unknown (reportAttributeAccessIssue)
-   /tmp/mypy_primer/projects/sympy/sympy/tensor/tests/test_tensor.py:554:13 - error: Cannot access attribute "canon_bp" for class "Zero"
-     Attribute "canon_bp" is unknown (reportAttributeAccessIssue)
-   /tmp/mypy_primer/projects/sympy/sympy/tensor/tests/test_tensor.py:554:13 - error: Cannot access attribute "canon_bp" for class "TensExpr"
+   /tmp/mypy_primer/projects/sympy/sympy/tensor/tests/test_tensor.py:554:13 - error: Cannot access attribute "canon_bp" for class "Expr*"
-     Attribute "canon_bp" is unknown (reportAttributeAccessIssue)
-   /tmp/mypy_primer/projects/sympy/sympy/tensor/tests/test_tensor.py:558:15 - error: Cannot access attribute "canon_bp" for class "Expr"
-     Attribute "canon_bp" is unknown (reportAttributeAccessIssue)
-   /tmp/mypy_primer/projects/sympy/sympy/tensor/tests/test_tensor.py:558:15 - error: Cannot access attribute "canon_bp" for class "Zero"
-     Attribute "canon_bp" is unknown (reportAttributeAccessIssue)
-   /tmp/mypy_primer/projects/sympy/sympy/tensor/tests/test_tensor.py:558:15 - error: Cannot access attribute "canon_bp" for class "One"
-     Attribute "canon_bp" is unknown (reportAttributeAccessIssue)
-   /tmp/mypy_primer/projects/sympy/sympy/tensor/tests/test_tensor.py:558:15 - error: Cannot access attribute "canon_bp" for class "NegativeOne"
-     Attribute "canon_bp" is unknown (reportAttributeAccessIssue)
-   /tmp/mypy_primer/projects/sympy/sympy/tensor/tests/test_tensor.py:558:15 - error: Cannot access attribute "canon_bp" for class "Integer"
-     Attribute "canon_bp" is unknown (reportAttributeAccessIssue)
-   /tmp/mypy_primer/projects/sympy/sympy/tensor/tests/test_tensor.py:558:15 - error: Cannot access attribute "canon_bp" for class "Rational"
-     Attribute "canon_bp" is unknown (reportAttributeAccessIssue)

... (truncated 223 lines) ...

@heejaechang heejaechang merged commit b105a38 into main Jan 29, 2025
18 checks passed
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.

3 participants