-
-
Notifications
You must be signed in to change notification settings - Fork 31.4k
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
Cannot include cpython/Include/internal/pycore_optimizer.h
in C++ extension due to use of protected C++ keyword "not"
#131331
Comments
My understanding is that there is no good way around this for C++ extensions: https://stackoverflow.com/questions/72177535/how-can-i-include-a-c-header-that-uses-a-c-keyword-as-an-identifier-in-c |
AFAIK, EDIT: I'm marking it as a release blocker if this implies that C++ extensions cannot be built anymore but if it's because of internal includes, then we can remove the label. |
The use is here: https://github.com/numba/numba/blob/main/numba/_dispatcher.cpp. The explanation to why they are using internal includes is https://github.com/numba/numba/blob/d650f3057839f99a0ab77262f27e80f4b9ae6739/numba/_dispatcher.cpp#L811 |
I think it doesn't hurt on our side if just use something else than EDIT: However, I would like to mention that using internal headers is at one's own risk, though, in this case, the fix on our side is easy. |
I would argue that allowing internal headers to be accessed in third-party code does hurt us. Regarding the numba issue. If there is a feature that is needed but does not have a public API, then we need to tell extension developers to submit a feature request, like this one from the Cython developers. |
Yes, in general, that's what I would say. But if the fix is simple enough and if it's easier than to make a feature request, then I'd say let's do it on our side. But I agree that I would prefer not to worry about compatibilty with projects including internal headers. Would you be willing to consider accepting my fix for this specific issue though? |
Bug report
Bug description:
The code in
cpython/Include/internal/pycore_optimizer.h
causing problemsCPython versions tested on:
3.14
Operating systems tested on:
macOS
Linked PRs
not
field toinvert
for C++ extension modules #131334The text was updated successfully, but these errors were encountered: