Skip to content

Conversation

erictraut
Copy link
Collaborator

…umption under certain circumstances involving reachability analysis. This change shouldn't result in any observable behavioral changes other than (theoretically) slightly less memory pressure.

…umption under certain circumstances involving reachability analysis. This change shouldn't result in any observable behavioral changes other than (theoretically) slightly less memory pressure.
Copy link
Contributor

github-actions bot commented Jun 9, 2025

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

sympy (https://github.com/sympy/sympy)
-   .../projects/sympy/sympy/tensor/array/tests/test_arrayop.py:140:59 - error: Cannot access attribute "tomatrix" for class "ArrayTensorProduct"
-     Attribute "tomatrix" is unknown (reportAttributeAccessIssue)
-     Attribute "tomatrix" is unknown (reportAttributeAccessIssue)
-   .../projects/sympy/sympy/tensor/array/tests/test_arrayop.py:140:59 - error: Cannot access attribute "tomatrix" for class "ArrayDiagonal"
-     Attribute "tomatrix" is unknown (reportAttributeAccessIssue)
-   .../projects/sympy/sympy/tensor/array/tests/test_arrayop.py:140:59 - error: Cannot access attribute "tomatrix" for class "ArrayAdd"
-   .../projects/sympy/sympy/tensor/array/tests/test_arrayop.py:157:49 - error: Argument of type "One | NDimArray | ImmutableDenseNDimArray | Unknown | Zero | ZeroArray | ArrayTensorProduct | ArrayContraction | Basic | ArrayDiagonal | ArrayAdd | PermuteDims | ImmutableSparseNDimArray* | ImmutableDenseNDimArray* | ImmutableSparseNDimArray" cannot be assigned to parameter "stop" of type "SupportsIndex" in function "__new__"
-     Type "One | NDimArray | ImmutableDenseNDimArray | Unknown | Zero | ZeroArray | ArrayTensorProduct | ArrayContraction | Basic | ArrayDiagonal | ArrayAdd | PermuteDims | ImmutableSparseNDimArray* | ImmutableDenseNDimArray* | ImmutableSparseNDimArray" is not assignable to type "SupportsIndex"
+   .../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"
-   .../projects/sympy/sympy/tensor/array/tests/test_arrayop.py:311:16 - error: "__getitem__" method not defined on type "ArrayTensorProduct" (reportIndexIssue)
-   .../projects/sympy/sympy/tensor/array/tests/test_arrayop.py:311:16 - error: "__getitem__" method not defined on type "ArrayDiagonal" (reportIndexIssue)
-   .../projects/sympy/sympy/tensor/array/tests/test_arrayop.py:311:16 - error: "__getitem__" method not defined on type "ArrayAdd" (reportIndexIssue)
-   .../projects/sympy/sympy/tensor/array/tests/test_arrayop.py:315:16 - error: "__getitem__" method not defined on type "ArrayTensorProduct" (reportIndexIssue)
-   .../projects/sympy/sympy/tensor/array/tests/test_arrayop.py:315:16 - error: "__getitem__" method not defined on type "ArrayDiagonal" (reportIndexIssue)
-   .../projects/sympy/sympy/tensor/array/tests/test_arrayop.py:315:16 - error: "__getitem__" method not defined on type "ArrayAdd" (reportIndexIssue)
-     Attribute "reshape" is unknown (reportAttributeAccessIssue)
-   .../projects/sympy/sympy/tensor/array/tests/test_arrayop.py:361:53 - error: Cannot access attribute "reshape" for class "ArrayDiagonal"
-   .../projects/sympy/sympy/tensor/array/tests/test_arrayop.py:361:53 - error: Cannot access attribute "reshape" for class "ArrayAdd"
-     Attribute "reshape" is unknown (reportAttributeAccessIssue)
-   .../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)
-   .../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)
-   .../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)
-   .../projects/sympy/sympy/tensor/tests/test_tensor.py:554:13 - error: Cannot access attribute "canon_bp" for class "TensExpr"
-     Attribute "canon_bp" is unknown (reportAttributeAccessIssue)
-   .../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)
-   .../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)
-   .../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)
-   .../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)
-   .../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)
-   .../projects/sympy/sympy/tensor/tests/test_tensor.py:558:15 - error: Cannot access attribute "canon_bp" for class "NaN"
-     Attribute "canon_bp" is unknown (reportAttributeAccessIssue)
-   .../projects/sympy/sympy/tensor/tests/test_tensor.py:558:15 - error: Cannot access attribute "canon_bp" for class "ComplexInfinity"
-     Attribute "canon_bp" is unknown (reportAttributeAccessIssue)
-   .../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)
-   .../projects/sympy/sympy/tensor/tests/test_tensor.py:558:15 - error: Cannot access attribute "canon_bp" for class "Infinity"
-     Attribute "canon_bp" is unknown (reportAttributeAccessIssue)
-   .../projects/sympy/sympy/tensor/tests/test_tensor.py:558:15 - error: Cannot access attribute "canon_bp" for class "NegativeInfinity"
-     Attribute "canon_bp" is unknown (reportAttributeAccessIssue)
-   .../projects/sympy/sympy/tensor/tests/test_tensor.py:558:15 - error: Cannot access attribute "canon_bp" for class "Float"
-     Attribute "canon_bp" is unknown (reportAttributeAccessIssue)
-   .../projects/sympy/sympy/tensor/tests/test_tensor.py:558:15 - error: Cannot access attribute "canon_bp" for class "Number"
-     Attribute "canon_bp" is unknown (reportAttributeAccessIssue)
-   .../projects/sympy/sympy/tensor/tests/test_tensor.py:577:13 - error: Cannot access attribute "canon_bp" for class "Expr"
-     Attribute "canon_bp" is unknown (reportAttributeAccessIssue)
-   .../projects/sympy/sympy/tensor/tests/test_tensor.py:577:13 - error: Cannot access attribute "canon_bp" for class "One"
-     Attribute "canon_bp" is unknown (reportAttributeAccessIssue)
-   .../projects/sympy/sympy/tensor/tests/test_tensor.py:577:13 - error: Cannot access attribute "canon_bp" for class "NegativeOne"
-     Attribute "canon_bp" is unknown (reportAttributeAccessIssue)
-   .../projects/sympy/sympy/tensor/tests/test_tensor.py:577:13 - error: Cannot access attribute "canon_bp" for class "Zero"
-     Attribute "canon_bp" is unknown (reportAttributeAccessIssue)
-   .../projects/sympy/sympy/tensor/tests/test_tensor.py:577:13 - error: Cannot access attribute "canon_bp" for class "Integer"
-     Attribute "canon_bp" is unknown (reportAttributeAccessIssue)
-   .../projects/sympy/sympy/tensor/tests/test_tensor.py:577:13 - error: Cannot access attribute "canon_bp" for class "NaN"
-     Attribute "canon_bp" is unknown (reportAttributeAccessIssue)
-   .../projects/sympy/sympy/tensor/tests/test_tensor.py:577:13 - error: Cannot access attribute "canon_bp" for class "ComplexInfinity"
-     Attribute "canon_bp" is unknown (reportAttributeAccessIssue)
-   .../projects/sympy/sympy/tensor/tests/test_tensor.py:577:13 - error: Cannot access attribute "canon_bp" for class "Rational"
-     Attribute "canon_bp" is unknown (reportAttributeAccessIssue)
-   .../projects/sympy/sympy/tensor/tests/test_tensor.py:577:13 - error: Cannot access attribute "canon_bp" for class "Infinity"
-     Attribute "canon_bp" is unknown (reportAttributeAccessIssue)
-   .../projects/sympy/sympy/tensor/tests/test_tensor.py:577:13 - error: Cannot access attribute "canon_bp" for class "NegativeInfinity"
-     Attribute "canon_bp" is unknown (reportAttributeAccessIssue)
-   .../projects/sympy/sympy/tensor/tests/test_tensor.py:577:13 - error: Cannot access attribute "canon_bp" for class "Float"
-     Attribute "canon_bp" is unknown (reportAttributeAccessIssue)
-   .../projects/sympy/sympy/tensor/tests/test_tensor.py:1602:36 - error: "__getitem__" method not defined on type "NegativeOne" (reportIndexIssue)
-   .../projects/sympy/sympy/tensor/tests/test_tensor.py:1602:36 - error: "__getitem__" method not defined on type "One" (reportIndexIssue)
-   .../projects/sympy/sympy/tensor/tests/test_tensor.py:1602:36 - error: "__getitem__" method not defined on type "TensExpr" (reportIndexIssue)
-   .../projects/sympy/sympy/tensor/tests/test_tensor.py:1608:43 - error: "__getitem__" method not defined on type "NegativeOne" (reportIndexIssue)
-   .../projects/sympy/sympy/tensor/tests/test_tensor.py:1608:43 - error: "__getitem__" method not defined on type "One" (reportIndexIssue)
-   .../projects/sympy/sympy/tensor/tests/test_tensor.py:1608:43 - error: "__getitem__" method not defined on type "TensExpr" (reportIndexIssue)
-   .../projects/sympy/sympy/tensor/tests/test_tensor.py:1663:41 - error: Operator "*" not supported for types "Literal[2]" and "Unknown | Any | Basic | Zero | ZeroArray | ArrayTensorProduct | ArrayDiagonal | ArrayAdd | ArrayContraction | Tuple | Indexed | ImmutableDenseNDimArray | NDimArray | None"

... (truncated 33 lines) ...

@erictraut erictraut merged commit 6adcbc8 into main Jun 9, 2025
17 checks passed
@erictraut erictraut deleted the codeFlowPerfBug branch June 9, 2025 16:30
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.

1 participant