◐ Shell
reader mode source ↗
Skip to content

bpo-39355: making Python.h compatible with C++20 compilers#31282

Closed
AliyevH wants to merge 7 commits into
python:mainfrom
AliyevH:main
Closed

bpo-39355: making Python.h compatible with C++20 compilers#31282
AliyevH wants to merge 7 commits into
python:mainfrom
AliyevH:main

Conversation

@AliyevH

@AliyevH AliyevH commented Feb 11, 2022

Copy link
Copy Markdown
Contributor

@erlend-aasland erlend-aasland left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hide comment

Thank you for your PR!

I would strongly suggest to rename to mod instead of pyModule. It is more aligned with the code style of the majority of the CPython code base.

Also:

  1. Please write a NEWS entry (I'm thinking something like "Make Python.h compatible with C++20 compilers", but there may be better ways to present this).
  2. Please add a note in What's New. The text itself can be just a C&P of the NEWS entry.
  3. Please update the PR title to more accurately reflect the change: you are making Python.h compatible with C++20 compilers.

IMO, we should probably backport this to 3.10 and 3.9. I'm adding the labels; if anyone disagrees, please remove them :)

@erlend-aasland

erlend-aasland commented Feb 11, 2022

Copy link
Copy Markdown
Contributor

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.

Renamed module to mod in header files
@AliyevH AliyevH changed the title bpo-39355: Renamed module to pyModule in header files Feb 11, 2022
@AliyevH

AliyevH commented Feb 11, 2022

Copy link
Copy Markdown
Contributor Author

@erlend-aasland Thanks for the corrections !

renamed pyModule to mod.
added misc.
now i don't have C++20 compiler installed and can't test it

@erlend-aasland

erlend-aasland commented Feb 11, 2022

Copy link
Copy Markdown
Contributor

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.

@vstinner

Copy link
Copy Markdown
Member

This PR solves a non-problem: https://bugs.python.org/issue39355#msg416257

@vstinner vstinner closed this Mar 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants