8000 BUG: Use isinstance for is_iterator on Cygwin by DWesl · Pull Request #46477 · pandas-dev/pandas · GitHub
[go: up one dir, main page]

Skip to content

BUG: Use isinstance for is_iterator on Cygwin #46477

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

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
BUG: Use isinstance for is_iterator on Cygwin
Fixes #45158 

Keep original implementation if not on Cygwin, and choose the implementation at compile time to avoid performance hits from the extra branch.

[Test results on Cygwin are available are available here](https://github.com/DWesl/pandas/runs/5648361139?check_suite_focus=true)
  • Loading branch information
DWesl authored Mar 22, 2022
commit 15a9739952279adfba5abe1db3ec25b08dda352d
5 changes: 4 additions & 1 deletion pandas/_libs/lib.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +2 5AA9 68,10 @@ def is_iterator(obj: object) -> bool:
>>> is_iterator(1)
False
"""
return PyIter_Check(obj)
IF UNAME_SYSNAME.startswith("CYGWIN"):
return isinstance(obj, abc.Iterator)
ELSE:
return PyIter_Check(obj)


def item_from_zerodim(val: object) -> object:
Expand Down
0