Skip to content

Conversation

cmp0xff
Copy link
Contributor

@cmp0xff cmp0xff commented Sep 26, 2025

  • Using _typeshed.SupportsRAdd and SupportsAdd in other, I am able to reduce 110 lines of code
  • Unfortunately I am not able to use SupportsAdd or SupportsRAdd in the typing of self
    • One can imagine something like def __add__(self: SupportsGetItem[Scalar, SupportsAdd[S1_CT, S1_CO]], S1_CT | Sequence[S1_CT]) -> S1_CO. However it does not work.

Copy link
Collaborator

@Dr-Irv Dr-Irv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A couple of comments that are questions.

@cmp0xff cmp0xff requested a review from Dr-Irv September 27, 2025 16:24
Copy link
Collaborator

@Dr-Irv Dr-Irv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks @cmp0xff

You understand this covariant/contravariant stuff better than me!

@Dr-Irv Dr-Irv merged commit b197a8b into pandas-dev:main Sep 27, 2025
13 checks passed
@cmp0xff cmp0xff deleted the feature/cmp0xff/simplify-add branch September 27, 2025 19:16
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.

2 participants