-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
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
MAINT: Always use PyCapsule instead of PyCObject in mtrand.pyx #7536
Conversation
Python 2.7 has a backport of PyCapsule so we no longer need to support PyCObject. This PR makes that change and removes the no longer needed mt_compat.h file.
The warning turned up when the numpy/randome/tests were run using $ python runtests.py -t numpy/random/tests/ It doesn't show when all the tests are run.
@@ -23,6 +23,7 @@ | |||
|
|||
include "Python.pxi" | |||
include "numpy.pxd" | |||
include "cpython/pycapsule.pxd" |
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.
I'm curious to see if this path is portable to Windows. I suspect not and wonder why the path isn't in the normal cython search path.
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.
Looks like it isn't a problem.
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.
Yeah, windows is totally happy to accept /
as a path separator.
Looks fine to me. I'm a little puzzled about why we're using PyCapsule at all here... I guess just because it's easier to have a dict-of-Python-callables than to have a dict-of-cdef-function-pointers? Doesn't matter much I guess. |
Yes, that was the problem, dict-of-cdef-function-pointers didn't work at all. |
I've toyed a bit with making the PyCapsule object public, but can't convince myself that it is a good idea. |
Strictly speaking, should probably check for error from |
Yeah, let's not go adding the whole |
Python 2.7 has a backport of PyCapsule so we no longer need to support PyCObject. This PR makes that change and removes the no longer needed mt_compat.h file.
Some Deprecation warning are also hidden in the
numpy/random/tests
.