Skip to content

Conversation

MarcoGorelli
Copy link
Member

@MarcoGorelli MarcoGorelli commented Oct 15, 2025

  • Closes #xxxx (Replace xxxx with the Github issue number)
  • Tests added: Please use assert_type() to assert the type of any return value

closes #1427

_ListLike is used in the Series constructor for the data argument, but I think it may be misnamed, as it's then been reused in other places that don't accept the same types (in particular, that don't accept dict)

So I've:

  • renamed _ListLike to _DataLike
  • used ListLike in other places which currently use _ListLike but don't actually accept dict input. In cases where we end up with ListLike | Index | Series, I've removed Index | Series as ListLike already contains them
  • For Index arithmetic methods, I've used ArrayLike | SequenceNotStr[S1], which is the same as what _ListLike was but without the extraneous dict[str, np.ndarray]

@MarcoGorelli MarcoGorelli changed the title use AnyArrayLike | SequenceNotStr for searchsorted Fix erroneous _ListLike type in Series / Index methods Oct 16, 2025
@MarcoGorelli MarcoGorelli marked this pull request as ready for review October 16, 2025 18:25
Copy link
Contributor

@cmp0xff cmp0xff left a comment

Choose a reason for hiding this comment

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

I like the changes. But there is a lot of them. I would like to wait for a second pair of eyes. cc @Dr-Irv @loicdiridollou

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 @MarcoGorelli

@Dr-Irv Dr-Irv merged commit 58de93c into pandas-dev:main Oct 19, 2025
13 checks passed
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.

_ListLike incorrect annotation for Series.searchsorted and Series.quantile

3 participants