Skip to content

[_operator] Type add and sub mimicking mul in #15598. #15601

Open
hunterhogan wants to merge 1 commit intopython:mainfrom
hunterhogan:operator.add_sub
Open

[_operator] Type add and sub mimicking mul in #15598. #15601
hunterhogan wants to merge 1 commit intopython:mainfrom
hunterhogan:operator.add_sub

Conversation

@hunterhogan
Copy link
Copy Markdown
Contributor

No description provided.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 3, 2026

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:2155: 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:2155: 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:2155: 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:2155: 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:2155: 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:2155: 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:2155: 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]

colour (https://github.com/colour-science/colour)
+ colour/utilities/array.py:547: error: Cannot call function of unknown type  [operator]
+ colour/io/luts/lut.py:638: error: Cannot call function of unknown type  [operator]
+ colour/continuous/signal.py:1089: error: Cannot call function of unknown type  [operator]

rotki (https://github.com/rotki/rotki)
+ rotkehlchen/utils/misc.py:199: error: Argument 1 to "sub" has incompatible type "V | Any"; expected "SupportsSub[Any, Any]"  [arg-type]
+ rotkehlchen/utils/misc.py:199: note: Error code "arg-type" not covered by "type: ignore" comment

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