-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Fixed bug in "literal math" logic for modulo and floor divide operato… #10168
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
Merged
Conversation
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
…rs that affect cases where operands have different signs. This addresses #10167.
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/expressions/tests/test_convert_array_to_matrix.py:170:41 - error: Argument of type "Unknown | Zero | ZeroArray | ArrayContraction | Basic | PermuteDims | ArrayAdd | ArrayDiagonal" cannot be assigned to parameter "expr" of type "ArrayDiagonal" in function "_array_diag2contr_diagmatrix"
- Type "Unknown | Zero | ZeroArray | ArrayContraction | Basic | PermuteDims | ArrayAdd | ArrayDiagonal" is not assignable to type "ArrayDiagonal"
- "Basic" is not assignable to "ArrayDiagonal" (reportArgumentType)
- /tmp/mypy_primer/projects/sympy/sympy/tensor/array/expressions/tests/test_convert_array_to_matrix.py:174:41 - error: Argument of type "Unknown | Zero | ZeroArray | ArrayContraction | Basic | PermuteDims | ArrayAdd | ArrayDiagonal" cannot be assigned to parameter "expr" of type "ArrayDiagonal" in function "_array_diag2contr_diagmatrix"
- Type "Unknown | Zero | ZeroArray | ArrayContraction | Basic | PermuteDims | ArrayAdd | ArrayDiagonal" is not assignable to type "ArrayDiagonal"
- "Basic" is not assignable to "ArrayDiagonal" (reportArgumentType)
- /tmp/mypy_primer/projects/sympy/sympy/tensor/array/expressions/tests/test_convert_array_to_matrix.py:180:41 - error: Argument of type "Unknown | Zero | ZeroArray | ArrayContraction | Basic | PermuteDims | ArrayAdd | ArrayDiagonal" cannot be assigned to parameter "expr" of type "ArrayDiagonal" in function "_array_diag2contr_diagmatrix"
- Type "Unknown | Zero | ZeroArray | ArrayContraction | Basic | PermuteDims | ArrayAdd | ArrayDiagonal" is not assignable to type "ArrayDiagonal"
- "Basic" is not assignable to "ArrayDiagonal" (reportArgumentType)
- /tmp/mypy_primer/projects/sympy/sympy/tensor/array/expressions/tests/test_convert_array_to_matrix.py:184:41 - error: Argument of type "Unknown | Zero | ZeroArray | ArrayContraction | Basic | PermuteDims | ArrayAdd | ArrayDiagonal" cannot be assigned to parameter "expr" of type "ArrayDiagonal" in function "_array_diag2contr_diagmatrix"
- Type "Unknown | Zero | ZeroArray | ArrayContraction | Basic | PermuteDims | ArrayAdd | ArrayDiagonal" is not assignable to type "ArrayDiagonal"
- "Basic" is not assignable to "ArrayDiagonal" (reportArgumentType)
- /tmp/mypy_primer/projects/sympy/sympy/tensor/array/expressions/tests/test_convert_array_to_matrix.py:188:41 - error: Argument of type "Unknown | Zero | ZeroArray | ArrayContraction | Basic | PermuteDims | ArrayAdd | ArrayDiagonal" cannot be assigned to parameter "expr" of type "ArrayDiagonal" in function "_array_diag2contr_diagmatrix"
- Type "Unknown | Zero | ZeroArray | ArrayContraction | Basic | PermuteDims | ArrayAdd | ArrayDiagonal" is not assignable to type "ArrayDiagonal"
- "Basic" is not assignable to "ArrayDiagonal" (reportArgumentType)
- /tmp/mypy_primer/projects/sympy/sympy/tensor/array/expressions/tests/test_convert_array_to_matrix.py:196:41 - error: Argument of type "Unknown | Zero | ZeroArray | ArrayContraction | Basic | PermuteDims | ArrayAdd | ArrayDiagonal" cannot be assigned to parameter "expr" of type "ArrayDiagonal" in function "_array_diag2contr_diagmatrix"
- Type "Unknown | Zero | ZeroArray | ArrayContraction | Basic | PermuteDims | ArrayAdd | ArrayDiagonal" is not assignable to type "ArrayDiagonal"
- "Basic" is not assignable to "ArrayDiagonal" (reportArgumentType)
- /tmp/mypy_primer/projects/sympy/sympy/tensor/array/expressions/tests/test_convert_array_to_matrix.py:205:41 - error: Argument of type "Unknown | Zero | ZeroArray | ArrayContraction | Basic | PermuteDims | ArrayAdd | ArrayDiagonal" cannot be assigned to parameter "expr" of type "ArrayDiagonal" in function "_array_diag2contr_diagmatrix"
- Type "Unknown | Zero | ZeroArray | ArrayContraction | Basic | PermuteDims | ArrayAdd | ArrayDiagonal" is not assignable to type "ArrayDiagonal"
- "Basic" is not assignable to "ArrayDiagonal" (reportArgumentType)
+ Attribute "split_multiple_contractions" is unknown (reportAttributeAccessIssue)
+ /tmp/mypy_primer/projects/sympy/sympy/tensor/array/expressions/tests/test_convert_array_to_matrix.py:213:15 - error: Cannot access attribute "split_multiple_contractions" for class "ArrayDiagonal"
+ Attribute "split_multiple_contractions" is unknown (reportAttributeAccessIssue)
+ /tmp/mypy_primer/projects/sympy/sympy/tensor/array/expressions/tests/test_convert_array_to_matrix.py:213:15 - error: Cannot access attribute "split_multiple_contractions" for class "ArrayAdd"
+ /tmp/mypy_primer/projects/sympy/sympy/tensor/array/expressions/tests/test_convert_array_to_matrix.py:217:15 - error: Cannot access attribute "split_multiple_contractions" for class "ArrayDiagonal"
+ Attribute "split_multiple_contractions" is unknown (reportAttributeAccessIssue)
+ /tmp/mypy_primer/projects/sympy/sympy/tensor/array/expressions/tests/test_convert_array_to_matrix.py:217:15 - error: Cannot access attribute "split_multiple_contractions" for class "ArrayAdd"
+ Attribute "split_multiple_contractions" is unknown (reportAttributeAccessIssue)
+ Attribute "split_multiple_contractions" is unknown (reportAttributeAccessIssue)
+ /tmp/mypy_primer/projects/sympy/sympy/tensor/array/expressions/tests/test_convert_array_to_matrix.py:223:15 - error: Cannot access attribute "split_multiple_contractions" for class "ArrayDiagonal"
+ Attribute "split_multiple_contractions" is unknown (reportAttributeAccessIssue)
+ /tmp/mypy_primer/projects/sympy/sympy/tensor/array/expressions/tests/test_convert_array_to_matrix.py:223:15 - error: Cannot access attribute "split_multiple_contractions" for class "ArrayAdd"
+ /tmp/mypy_primer/projects/sympy/sympy/tensor/array/expressions/tests/test_convert_array_to_matrix.py:227:15 - error: Cannot access attribute "split_multiple_contractions" for class "ArrayDiagonal"
+ Attribute "split_multiple_contractions" is unknown (reportAttributeAccessIssue)
+ /tmp/mypy_primer/projects/sympy/sympy/tensor/array/expressions/tests/test_convert_array_to_matrix.py:227:15 - error: Cannot access attribute "split_multiple_contractions" for class "ArrayAdd"
+ Attribute "split_multiple_contractions" is unknown (reportAttributeAccessIssue)
+ Attribute "split_multiple_contractions" is unknown (reportAttributeAccessIssue)
+ /tmp/mypy_primer/projects/sympy/sympy/tensor/array/expressions/tests/test_convert_array_to_matrix.py:231:15 - error: Cannot access attribute "split_multiple_contractions" for class "ArrayDiagonal"
+ Attribute "split_multiple_contractions" is unknown (reportAttributeAccessIssue)
+ /tmp/mypy_primer/projects/sympy/sympy/tensor/array/expressions/tests/test_convert_array_to_matrix.py:231:15 - error: Cannot access attribute "split_multiple_contractions" for class "ArrayAdd"
+ /tmp/mypy_primer/projects/sympy/sympy/tensor/array/expressions/tests/test_convert_array_to_matrix.py:235:15 - error: Cannot access attribute "split_multiple_contractions" for class "ArrayDiagonal"
+ Attribute "split_multiple_contractions" is unknown (reportAttributeAccessIssue)
+ /tmp/mypy_primer/projects/sympy/sympy/tensor/array/expressions/tests/test_convert_array_to_matrix.py:235:15 - error: Cannot access attribute "split_multiple_contractions" for class "ArrayAdd"
+ Attribute "split_multiple_contractions" is unknown (reportAttributeAccessIssue)
+ Attribute "split_multiple_contractions" is unknown (reportAttributeAccessIssue)
+ /tmp/mypy_primer/projects/sympy/sympy/tensor/array/expressions/tests/test_convert_array_to_matrix.py:241:15 - error: Cannot access attribute "split_multiple_contractions" for class "ArrayDiagonal"
+ Attribute "split_multiple_contractions" is unknown (reportAttributeAccessIssue)
+ /tmp/mypy_primer/projects/sympy/sympy/tensor/array/expressions/tests/test_convert_array_to_matrix.py:241:15 - error: Cannot access attribute "split_multiple_contractions" for class "ArrayAdd"
+ /tmp/mypy_primer/projects/sympy/sympy/tensor/array/expressions/tests/test_convert_array_to_matrix.py:245:39 - error: Cannot access attribute "split_multiple_contractions" for class "ArrayDiagonal"
+ Attribute "split_multiple_contractions" is unknown (reportAttributeAccessIssue)
+ /tmp/mypy_primer/projects/sympy/sympy/tensor/array/expressions/tests/test_convert_array_to_matrix.py:245:39 - error: Cannot access attribute "split_multiple_contractions" for class "ArrayAdd"
+ Attribute "split_multiple_contractions" is unknown (reportAttributeAccessIssue)
+ Attribute "split_multiple_contractions" is unknown (reportAttributeAccessIssue)
+ /tmp/mypy_primer/projects/sympy/sympy/tensor/array/expressions/tests/test_convert_array_to_matrix.py:249:15 - error: Cannot access attribute "split_multiple_contractions" for class "ArrayDiagonal"
+ Attribute "split_multiple_contractions" is unknown (reportAttributeAccessIssue)
+ /tmp/mypy_primer/projects/sympy/sympy/tensor/array/expressions/tests/test_convert_array_to_matrix.py:249:15 - error: Cannot access attribute "split_multiple_contractions" for class "ArrayAdd"
+ /tmp/mypy_primer/projects/sympy/sympy/tensor/array/expressions/tests/test_convert_array_to_matrix.py:255:15 - error: Cannot access attribute "split_multiple_contractions" for class "ArrayDiagonal"
+ Attribute "split_multiple_contractions" is unknown (reportAttributeAccessIssue)
+ /tmp/mypy_primer/projects/sympy/sympy/tensor/array/expressions/tests/test_convert_array_to_matrix.py:255:15 - error: Cannot access attribute "split_multiple_contractions" for class "ArrayAdd"
+ Attribute "split_multiple_contractions" is unknown (reportAttributeAccessIssue)
... (truncated 365 lines) ...
|
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.
…rs that affect cases where operands have different signs. This addresses #10167.