Skip to content

C standard #22

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

Open
encukou opened this issue Oct 11, 2023 · 3 comments
Open

C standard #22

encukou opened this issue Oct 11, 2023 · 3 comments
Labels
guideline To be included in guidelines PEP

Comments

@encukou
Copy link
Contributor

encukou commented Oct 11, 2023

Most of this is already in PEP-7. IMO we should move guidelines with user-visible effects out of the style guide.

This is not only about the external API, but the guideline PEP might be a good place for it.

Python requires C11 without optional features.
The public C API should be compatible with C++. (XXX Which C++?)

It is OK to use optional and compiler-specific features for optimizations and optional Python features.

We can update the C/C++ version or add an optional C feature can only be done with Steering Council approval. We recommend the SC check that:

  • all major compilers support the feature
  • it's done only before the first Beta of new feature release,

(Note: atomics are an optional C feature, and AFAIK will be needed for nogil)

@encukou encukou added the guideline To be included in guidelines PEP label Oct 11, 2023
@pitrou
Copy link

pitrou commented Oct 14, 2023

Which C++?

All versions from C++11 upwards should be able to ingest the Python C headers IMHO.
C++98 may also apply, depending on how conservative you want to be.

@gpshead
Copy link

gpshead commented Oct 26, 2023

All versions from C++11 upwards should be able to ingest the Python C headers IMHO.

Be careful with that belief... Recent C++ versions are evolving away from being compatible with recent C versions.

@pitrou
Copy link

pitrou commented Oct 26, 2023

Ah, language is ambiguous. I did not mean "should" as in "I'm sure they do" but "CPython should feel an obligation to ensure that".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
guideline To be included in guidelines PEP
Projects
None yet
Development

No branches or pull requests

3 participants