Skip to content

Conversation

charris
Copy link
Member

@charris charris commented Sep 23, 2025

Backport of #29733.

Follow-up of #29695 and #29706, resolving python/mypy#15993 (comment)

@charris charris added this to the 2.3.4 release milestone Sep 23, 2025
@charris charris added 08 - Backport Used to tag backport PRs 41 - Static typing labels Sep 23, 2025
Copy link

Diff from mypy_primer, showing the effect of this PR on type check results on a corpus of open source code:

scipy-stubs (https://github.com/scipy/scipy-stubs)
+ scipy-stubs/signal/_ltisys.pyi:388: error: Unused "type: ignore" comment  [unused-ignore]
+ scipy-stubs/signal/_ltisys.pyi:389: error: Unused "type: ignore" comment  [unused-ignore]
+ scipy-stubs/signal/_ltisys.pyi:390: error: Unused "type: ignore" comment  [unused-ignore]

freqtrade (https://github.com/freqtrade/freqtrade)
- freqtrade/data/converter/orderflow.py:175: error: No overload variant of "__call__" of "_FloatOp" matches argument type "str"  [call-overload]
+ freqtrade/data/converter/orderflow.py:175: error: No overload variant of "__rsub__" of "floating" matches argument type "str"  [operator]
+ freqtrade/data/converter/orderflow.py:175: note:     def __rsub__(self, int | floating[_16Bit] | unsignedinteger[_8Bit] | signedinteger[_8Bit] | numpy.bool[builtins.bool], /) -> floating[Any]
+ freqtrade/data/converter/orderflow.py:175: note:     def __rsub__(self, integer[Any] | floating[Any], /) -> floating[Any]
- freqtrade/data/converter/orderflow.py:175: note:     def __call__(self, int, /) -> floating[Any]
+ freqtrade/data/converter/orderflow.py:175: note:     def __rsub__(self, float, /) -> floating[Any]
- freqtrade/data/converter/orderflow.py:175: note:     def __call__(self, float, /) -> floating[Any] | float64
- freqtrade/data/converter/orderflow.py:175: note:     def __call__(self, complex, /) -> complexfloating[Any, Any] | complex128
+ freqtrade/data/converter/orderflow.py:175: note:     def __rsub__(self, complex, /) -> complexfloating[Any, Any]
- freqtrade/data/converter/orderflow.py:175: note:     def [_NBit2: NBitBase] __call__(self, integer[_NBit2] | floating[_NBit2], /) -> floating[Any] | floating[_NBit2]
- freqtrade/data/converter/orderflow.py:175: error: No overload variant of "__call__" of "_FloatOp" matches argument type "bytes"  [call-overload]
+ freqtrade/data/converter/orderflow.py:175: error: No overload variant of "__rsub__" of "floating" matches argument type "bytes"  [operator]
+ freqtrade/data/converter/orderflow.py:175: error: No overload variant of "__sub__" of "floating" matches argument type "str"  [operator]
+ freqtrade/data/converter/orderflow.py:175: note:     def __sub__(self, int | floating[_16Bit] | unsignedinteger[_8Bit] | signedinteger[_8Bit] | numpy.bool[builtins.bool] | floating[Any], /) -> floating[Any]
+ freqtrade/data/converter/orderflow.py:175: note:     def __sub__(self, integer[Any] | floating[Any], /) -> floating[Any]
+ freqtrade/data/converter/orderflow.py:175: note:     def __sub__(self, float, /) -> floating[Any]
+ freqtrade/data/converter/orderflow.py:175: note:     def __sub__(self, complex, /) -> complexfloating[Any, Any]
+ freqtrade/data/converter/orderflow.py:175: error: No overload variant of "__sub__" of "floating" matches argument type "bytes"  [operator]
- freqtrade/data/converter/orderflow.py:175: error: No overload variant of "__call__" of "_FloatOp" matches argument type "date"  [call-overload]
+ freqtrade/data/converter/orderflow.py:175: error: No overload variant of "__sub__" of "floating" matches argument type "date"  [operator]
- freqtrade/data/converter/orderflow.py:175: error: No overload variant of "__call__" of "_FloatOp" matches argument type "datetime"  [call-overload]
+ freqtrade/data/converter/orderflow.py:175: error: No overload variant of "__sub__" of "floating" matches argument type "datetime"  [operator]
- freqtrade/data/converter/orderflow.py:175: error: No overload variant of "__call__" of "_FloatOp" matches argument type "timedelta"  [call-overload]
+ freqtrade/data/converter/orderflow.py:175: error: No overload variant of "__sub__" of "floating" matches argument type "timedelta"  [operator]
- freqtrade/data/converter/orderflow.py:175: error: No overload variant of "__call__" of "_FloatOp" matches argument type "datetime64[date | int | None]"  [call-overload]
+ freqtrade/data/converter/orderflow.py:175: error: No overload variant of "__sub__" of "floating" matches argument type "datetime64[date | int | None]"  [operator]
- freqtrade/data/converter/orderflow.py:175: error: No overload variant of "__call__" of "_FloatOp" matches argument type "timedelta64[timedelta | int | None]"  [call-overload]
+ freqtrade/data/converter/orderflow.py:175: error: No overload variant of "__sub__" of "floating" matches argument type "timedelta64[timedelta | int | None]"  [operator]
- freqtrade/data/converter/orderflow.py:175: error: No overload variant of "__call__" of "_FloatOp" matches argument type "Timestamp"  [call-overload]
+ freqtrade/data/converter/orderflow.py:175: error: No overload variant of "__sub__" of "floating" matches argument type "Timestamp"  [operator]
- freqtrade/data/converter/orderflow.py:175: error: No overload variant of "__call__" of "_FloatOp" matches argument type "Timedelta"  [call-overload]
+ freqtrade/data/converter/orderflow.py:175: error: No overload variant of "__sub__" of "floating" matches argument type "Timedelta"  [operator]

pandas-stubs (https://github.com/pandas-dev/pandas-stubs)
+ pandas-stubs/_libs/tslibs/timestamps.pyi:181: error: Unused "type: ignore" comment  [unused-ignore]
+ pandas-stubs/_libs/tslibs/timestamps.pyi:191: error: Unused "type: ignore" comment  [unused-ignore]
+ pandas-stubs/_libs/tslibs/timestamps.pyi:201: error: Unused "type: ignore" comment  [unused-ignore]
+ pandas-stubs/_libs/tslibs/timestamps.pyi:211: error: Unused "type: ignore" comment  [unused-ignore]
+ pandas-stubs/_libs/tslibs/timedeltas.pyi:353: error: Unused "type: ignore" comment  [unused-ignore]
+ pandas-stubs/_libs/tslibs/timedeltas.pyi:364: error: Unused "type: ignore" comment  [unused-ignore]
+ pandas-stubs/_libs/tslibs/timedeltas.pyi:375: error: Unused "type: ignore" comment  [unused-ignore]
+ pandas-stubs/_libs/tslibs/timedeltas.pyi:386: error: Unused "type: ignore" comment  [unused-ignore]

@charris charris merged commit c870d84 into numpy:maintenance/2.3.x Sep 23, 2025
77 checks passed
@charris charris deleted the backport-29733 branch September 23, 2025 14:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

08 - Backport Used to tag backport PRs 41 - Static typing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants