Fixed a bug in "literal math" for shift operators. If the RHS value i…#10166
Merged
Conversation
…s negative, the operation is invalid, so literal math shouldn't be applied. This addresses #10165.
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/utilities/codegen.py:608:47 - error: "__getitem__" method not defined on type "set[Unknown]" (reportIndexIssue)
+ "__iter__" method not defined (reportGeneralTypeIssues)
+ /tmp/mypy_primer/projects/sympy/sympy/utilities/codegen.py:622:34 - error: "Relational" is not iterable
+ "__iter__" method not defined (reportGeneralTypeIssues)
+ /tmp/mypy_primer/projects/sympy/sympy/utilities/codegen.py:622:34 - error: "Unequality" is not iterable
+ "__iter__" method not defined (reportGeneralTypeIssues)
+ /tmp/mypy_primer/projects/sympy/sympy/utilities/codegen.py:622:34 - error: "Integer" is not iterable
+ /tmp/mypy_primer/projects/sympy/sympy/utilities/matchpy_connector.py:288:16 - error: Type "Basic" is not assignable to declared type "Expr"
+ "Basic" is not assignable to "Expr" (reportAssignmentType)
+ /tmp/mypy_primer/projects/sympy/sympy/utilities/tests/test_autowrap.py
+ /tmp/mypy_primer/projects/sympy/sympy/utilities/tests/test_autowrap.py:267:14 - error: Cannot access attribute "_imp_" for class "type[AppliedUndef]"
+ Attribute "_imp_" is unknown (reportAttributeAccessIssue)
+ /tmp/mypy_primer/projects/sympy/sympy/utilities/tests/test_autowrap.py:267:14 - error: Cannot access attribute "_imp_" for class "UndefinedFunction"
+ Attribute "_imp_" is unknown (reportAttributeAccessIssue)
- /tmp/mypy_primer/projects/sympy/sympy/utilities/tests/test_lambdify.py:2032:45 - error: Argument of type "(e: Unknown) -> (tuple[Unknown, str] | tuple[Unknown | list[tuple[Unknown, Unknown]], list[Unknown] | set[Unknown] | tuple[Unknown, ...]] | tuple[Unknown | list[tuple[Unknown, Unknown]], dict[Unknown, Unknown]] | tuple[Unknown | list[tuple[Unknown, Unknown]], Unknown] | tuple[list[Unknown], Unknown] | tuple[list[tuple[Unknown, Unknown]], list[Unknown]] | Unknown)" cannot be assigned to parameter "cse" of type "bool" in function "lambdify"
+ /tmp/mypy_primer/projects/sympy/sympy/utilities/tests/test_lambdify.py:2032:45 - error: Argument of type "(e: Unknown) -> (Unknown | tuple[list[tuple[Unknown, Unknown]], list[Unknown]])" cannot be assigned to parameter "cse" of type "bool" in function "lambdify"
- 33069 errors, 72 warnings, 0 informations
+ 33074 errors, 72 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.
…s negative, the operation is invalid, so literal math shouldn't be applied. This addresses #10165.