GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||
GeezerVison is showing github.com — bpo-39355: making Python.h compatible with C++20 compilers by AliyevH · Pull Request #31282 · python/cpython Conversation
| ||||||||||||||||||||||
|
BTW, did you test that it is actually possible to use a C++20 compiler for external modules after this change? AFAICS, it should be ok, but assumption has resulted in a lot of strange stuff. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Renamed module to mod in header files
| @@ -0,0 +1 @@ | |||
| Make Python.h compatible with C++20 compilers | |||
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Nitpick:
| Make Python.h compatible with C++20 compilers | |
| Make Python.h compatible with C++20 compilers. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@erlend-aasland Thanks for the corrections ! renamed pyModule to mod. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
Thanks for the amendments, Hasan. Could you please also add an entry to What's New. Something like this should suffice (given that this actually is a sufficient change): diff --git a/Doc/whatsnew/3.11.rst b/Doc/whatsnew/3.11.rst index 5738745ba1..4cf489ad5e 100644 --- a/Doc/whatsnew/3.11.rst +++ b/Doc/whatsnew/3.11.rst @@ -650,6 +650,9 @@ Build Changes be removed at some point in the future. (Contributed by Mark Dickinson in :issue:`45569`.) +* Python.h is now compatible with C++20 compilers. (Contributed by by Hasan + Aliyev in :issue:`39355`.) + C API Changes ============= I'll see if I can get around to test it using G++ 11. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| @@ -0,0 +1 @@ | |||
| Make Python.h compatible with C++20 compilers. | |||
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Would you mind to explain that the change is to avoid the usage of "module" which became a keyword in C++20?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Yes @vstinner, you are right!
I have mentioned in bugs.python.org, about this change.
After making a little research, i realized that this "module" keyword has meaning with "export"
Sorry i am not c++ expert )) If somebody have knowledge about it, share it plz :)
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
I don't understand your comment. Do you mean that https://bugs.python.org/issue39355 is not a bug and the Python C API is compatible with C++20?
If there is an issue, please explain the change in NEWS entry. "Make Python.h compatible with C++20 compilers." is not enough.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
@vstinner I asked question ))
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
@vstinner it was interesting for me, if "module" keyword has meaning with "export" how gcc will treat "module" without "export" keyword ?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
So far, I failed to reproduce https://bugs.python.org/issue39355 issue: using the Python C API in C++ doesn't emit any compiler warning or compiler error. See my test: https://bugs.python.org/issue39355#msg416256
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
@vstinner thanks for great investigation!
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
You're welcome. I'm now considering serious to convert #32175 to a real unit test to make sure that the Python C API is compatible with C++.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
First step: https://bugs.python.org/issue47164
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
This PR solves a non-problem: https://bugs.python.org/issue39355#msg416257 |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.