Skip to content
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

Simplify DataFrame.__getitem__ #771

Merged
merged 4 commits into from
Sep 1, 2023
Merged

Conversation

twoertwein
Copy link
Member

@overload
def __getitem__(self, key: slice) -> DataFrame: ...
def __getitem__(self, key: Iterable[Scalar | Hashable] | slice) -> DataFrame: ...
Copy link
Collaborator

Choose a reason for hiding this comment

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

Could this be simplified to just Iterable[Hashable], since anything that is Scalar is Hashable ? (Same for __iter__())

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, that is possible - changed it!

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

@Dr-Irv Dr-Irv merged commit 6bb1215 into pandas-dev:main Sep 1, 2023
10 checks passed
@twoertwein twoertwein deleted the getitem branch February 10, 2024 20:31
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.

DataFrame.__getitem__ returns wrong type for a dict_keys object
2 participants