TYP: GH1474 Remove deprecated NumListLike and collapse arithmetic Sequence overloads#1686
Draft
cmp0xff wants to merge 1 commit intopandas-dev:mainfrom
Draft
TYP: GH1474 Remove deprecated NumListLike and collapse arithmetic Sequence overloads#1686cmp0xff wants to merge 1 commit intopandas-dev:mainfrom
cmp0xff wants to merge 1 commit intopandas-dev:mainfrom
Conversation
96267bb to
78bc416
Compare
78bc416 to
0675969
Compare
0675969 to
5aa84b0
Compare
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.
Summary
Closes #1474. Propagates the fix for pandas-dev/pandas#62353.
Remove
NumListLike(resolves #1474)NumListLikewas introduced in #1360 and contained a suspiciousdict[str, np.ndarray]member. It was never correct for arithmetic operations and was marked for deprecation. This PR removes it entirely frombase.pyiand inlines its components directly into each arithmetic method'sotherparameter:__mul__/__rmul__/mul/rmulonSeries[Never]__sub__/subonSeries[Never]__sub__/subonSeries[Timestamp]Collapse
__add__/__radd__Sequence workaround (pandas-dev/pandas#62353)The old workaround introduced two separate overloads to handle the case where
otheris a sequence — one restricted to non-datetime scalar types viaS2_NDT_contra— because pandas used to raise aTypeErrorfor datetime array arithmetic with lists. Now that the upstream issue is fixed:other: SupportsRAdd[S2_contra, S2] | Sequence[SupportsRAdd[S2_contra, S2]]S2_NDT_contraimport fromseries.pyiSequence[datetime]toSeries[Timestamp].__sub__so list-of-datetime subtraction is covered🤖 Co-authored by Claude Sonnet 4.6