Skip to content

CLN: Update cpython imports in Cython Code GH28382 #28398

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

Merged
merged 2 commits into from
Sep 13, 2019

Conversation

amunch
Copy link
Contributor

@amunch amunch commented Sep 12, 2019

Apologies if anything is not ideal, as this is my first pull request here. Any suggestions or comments are much appreciated!

from cpython.long cimport PyLong_Check
from cpython.object cimport PyCallable_Check
from cpython.tuple cimport PyTuple_Check
from cpython.unicode cimport PyUnicode_Check, PyUnicode_AsEncodedString
Copy link
Member

Choose a reason for hiding this comment

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

doesnt need to be for this PR, but most/all of the PyFoo_Check calls can be replaced with their pure-python equivalents; cython will now automatically make the optimization

Copy link
Member

Choose a reason for hiding this comment

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

So basically replace this with isinstance checks right? I think OK as a separate PR @amunch if that's something you'd also like to tackle

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sounds good, I will replace these checks in a separate pull request.

Copy link
Member

@WillAyd WillAyd left a comment

Choose a reason for hiding this comment

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

Looks good. Can you merge master and repush? I think will resolve CI failure

from cpython.long cimport PyLong_Check
from cpython.object cimport PyCallable_Check
from cpython.tuple cimport PyTuple_Check
from cpython.unicode cimport PyUnicode_Check, PyUnicode_AsEncodedString
Copy link
Member

Choose a reason for hiding this comment

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

So basically replace this with isinstance checks right? I think OK as a separate PR @amunch if that's something you'd also like to tackle

@WillAyd WillAyd added the Clean label Sep 12, 2019
@WillAyd WillAyd added this to the 1.0 milestone Sep 12, 2019
@amunch
Copy link
Contributor Author

amunch commented Sep 12, 2019

@WillAyd Looks like merging master resolved the CI issues!

Copy link
Member

@WillAyd WillAyd left a comment

Choose a reason for hiding this comment

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

@jbrockmendel
Copy link
Member

LGTM. Should we add a code check for this?

@WillAyd
Copy link
Member

WillAyd commented Sep 13, 2019

Should we add a code check for this?

Not against it if someone wants to take that up, but don't think needs to be done as part of this PR

@WillAyd WillAyd merged commit eb8cce0 into pandas-dev:master Sep 13, 2019
@WillAyd
Copy link
Member

WillAyd commented Sep 13, 2019

Thanks @amunch - great first PR

jmg7173 pushed a commit to jmg7173/pandas that referenced this pull request Sep 14, 2019
proost pushed a commit to proost/pandas that referenced this pull request Dec 19, 2019
proost pushed a commit to proost/pandas that referenced this pull request Dec 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update cpython imports in Cython Code
3 participants