- 
          
- 
                Notifications
    You must be signed in to change notification settings 
- Fork 152
Type CategoricalIndex #1459
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Type CategoricalIndex #1459
Conversation
| limit=..., | ||
| tolerance=..., | ||
| ): ... | ||
| target: Iterable[Any], | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the docs just say "iterable"
There was a problem hiding this comment.
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.
There was a problem hiding this 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], | 
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @MarcoGorelli !
closes #1443
assert_type()to assert the type of any return value