Rewrite operator Library with More Specific Annotations#15059
Closed
George-Ogden wants to merge 2 commits intopython:mainfrom
Closed
Rewrite operator Library with More Specific Annotations#15059George-Ogden wants to merge 2 commits intopython:mainfrom
operator Library with More Specific Annotations#15059George-Ogden wants to merge 2 commits intopython:mainfrom
Conversation
Contributor
|
Diff from mypy_primer, showing the effect of this PR on open source code: spark (https://github.com/apache/spark)
+ python/pyspark/core/rdd.py:2159: error: Argument 2 to "fold" of "RDD" has incompatible type overloaded function; expected "Callable[[float | Literal[0], float | Literal[0]], float | Literal[0]]" [arg-type]
+ python/pyspark/core/rdd.py:2159: error: Argument 2 to "fold" of "RDD" has incompatible type overloaded function; expected "Callable[[complex | Literal[0], complex | Literal[0]], complex | Literal[0]]" [arg-type]
+ python/pyspark/core/rdd.py:2159: error: Argument 2 to "fold" of "RDD" has incompatible type overloaded function; expected "Callable[[signedinteger[_32Bit] | Literal[0], signedinteger[_32Bit] | Literal[0]], signedinteger[_32Bit] | Literal[0]]" [arg-type]
+ python/pyspark/core/rdd.py:2159: error: Argument 2 to "fold" of "RDD" has incompatible type overloaded function; expected "Callable[[signedinteger[_64Bit] | Literal[0], signedinteger[_64Bit] | Literal[0]], signedinteger[_64Bit] | Literal[0]]" [arg-type]
+ python/pyspark/core/rdd.py:2159: error: Argument 2 to "fold" of "RDD" has incompatible type overloaded function; expected "Callable[[floating[_32Bit] | Literal[0], floating[_32Bit] | Literal[0]], floating[_32Bit] | Literal[0]]" [arg-type]
+ python/pyspark/core/rdd.py:2159: error: Argument 2 to "fold" of "RDD" has incompatible type overloaded function; expected "Callable[[float64 | Literal[0], float64 | Literal[0]], float64 | Literal[0]]" [arg-type]
+ python/pyspark/core/rdd.py:2159: error: Argument 2 to "fold" of "RDD" has incompatible type overloaded function; expected "Callable[[ndarray[tuple[Any, ...], dtype[Any]] | Literal[0], ndarray[tuple[Any, ...], dtype[Any]] | Literal[0]], ndarray[tuple[Any, ...], dtype[Any]] | Literal[0]]" [arg-type]
rotki (https://github.com/rotki/rotki)
+ rotkehlchen/chain/ethereum/oracles/uniswap.py:323: error: Argument 1 to "reduce" has incompatible type overloaded function; expected "Callable[[int, FVal], int]" [arg-type]
sympy (https://github.com/sympy/sympy)
+ sympy/polys/matrices/dense.py:104: error: Incompatible types in assignment (expression has type "RingElement", target has type "R") [assignment]
jax (https://github.com/google/jax)
+ jax/experimental/mosaic/gpu/dialect_lowering.py:1144: error: Argument "impl" to "_binary_op_lowering_rule" has incompatible type "function"; expected "Callable[[FragmentedArray, FragmentedArray], FragmentedArray]" [arg-type]
|
Author
|
All of these are false positives, will look into #15058 in more detail |
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.
This PR is similar to #15058, except it removes the fallback
operator(a: Any, b: Any, /) -> Any. I'll copy the details here if this one doesn't produce spurious results, but I expect it might.