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
PyCFunction_New is not exported with PyAPI_FUNC #87405
Comments
PyCFunction_New is part of the Stable ABI (see bpo-21354), but it is not declared as PyAPI_FUNC, and thus not exported with GCC's -fvisibility=hidden. (I don't think this has any real impact, I just want to fix it before enabling automatic tests on such issues.) |
Oh, it's not listed by Doc/data/stable_abi.dat and so not checked by Tools/scripts/stable_abi.py. It's implemented explicitly as a function only for the stable ABI: PyObject *
PyCFunction_New(PyMethodDef *ml, PyObject *self)
{
return PyCFunction_NewEx(ml, self, NULL);
} So yeah, it should be exported. By the way, I would suggest to move "#define PyCFunction_New(ML, SELF) PyCFunction_NewEx((ML), (SELF), NULL)" to Include/cpython/methodobject.h to clarify that the limited C API should call "PyCFunction_New()" and not call "PyCFunction_NewEx()". |
OK, I'll add that move to the PR.
I'm planning to rework this for PEP-652 (which is how I found the issue in the first place), so I'll not add it there now. |
Wait no, I wrote too soon. |
Find some 3rd user calling this function in: https://searchcode.com/?q=PyCFunction_NewEx+. So I prefer to keep it too. |
It seems to me that this issue can be closed as fixed. Do you have further PR's for this, Petr? |
Closing as it seems fixed, feel free to reopen if required. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: