Skip to content

Conversation

@MarcoGorelli
Copy link
Member

closes #1443

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

@MarcoGorelli MarcoGorelli marked this pull request as ready for review October 30, 2025 16:26
limit=...,
tolerance=...,
): ...
target: Iterable[Any],
Copy link
Member Author

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

It works for a non-Sequence generator. Fun fact:

>>> import pandas as pd
>>> pd.Index([1, 2, 3]).reindex(range(1, 3))
(RangeIndex(start=1, stop=3, step=1), array([0, 1]))

Maybe for another PR.

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.

Please remove the following from pyproject.toml

"*category.pyi" = [
  # TODO: remove when pandas-dev/pandas-stubs#1443 is resolved
  "ANN001", "ANN201", "ANN204", "ANN206",
]

limit=...,
tolerance=...,
): ...
target: Iterable[Any],
Copy link
Contributor

Choose a reason for hiding this comment

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

It works for a non-Sequence generator. Fun fact:

>>> import pandas as pd
>>> pd.Index([1, 2, 3]).reindex(range(1, 3))
(RangeIndex(start=1, stop=3, step=1), array([0, 1]))

Maybe for another PR.

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.

Thank you @MarcoGorelli !

@cmp0xff cmp0xff merged commit 251b9ad into pandas-dev:main Oct 31, 2025
16 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.

Typing CategoricalIndex

2 participants