Skip to content

Conversation

MarcoGorelli
Copy link
Member

closes #1356

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

SupportsDType,
np_1darray,
)
from pandas.util._decorators import cache_readonly

_ListLike: TypeAlias = ArrayLike | dict[str, np.ndarray] | SequenceNotStr[S1]
Copy link
Member Author

Choose a reason for hiding this comment

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

not sure why this gets redefined in multiple files, but i've kept to the pattern

ok, or better to redefine in _typing?

Copy link
Collaborator

Choose a reason for hiding this comment

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

If you do want to use it here, then I think moving the definition to typing.pyi makes sense, but exercise care on the naming, because there is a ListLike in _typing that is used elsewhere and I'm not sure whether they should be the same or not. Maybe the name _ListLike is misleading.

Might be better to do the copying like you've done here, OR have series.pyi import _ListLike from core/base.pyi

Copy link
Member Author

Choose a reason for hiding this comment

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

Might be better to do the copying like you've done here

sure, keeping like this for now then, thanks

@MarcoGorelli MarcoGorelli marked this pull request as ready for review August 29, 2025 16:38
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.

ping when I should do the full review, but it looks OK for now

SupportsDType,
np_1darray,
)
from pandas.util._decorators import cache_readonly

_ListLike: TypeAlias = ArrayLike | dict[str, np.ndarray] | SequenceNotStr[S1]
Copy link
Collaborator

Choose a reason for hiding this comment

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

If you do want to use it here, then I think moving the definition to typing.pyi makes sense, but exercise care on the naming, because there is a ListLike in _typing that is used elsewhere and I'm not sure whether they should be the same or not. Maybe the name _ListLike is misleading.

Might be better to do the copying like you've done here, OR have series.pyi import _ListLike from core/base.pyi

@MarcoGorelli
Copy link
Member Author

sure, happy for you to take a look, thanks!

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 ffa88e5 into pandas-dev:main Aug 29, 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.

Index.searchsorted return type incorrect
2 participants