capi-workgroup / api-evolution

Issues related to evolution of the C API
12 stars 1 forks source link

C standard #22

Open encukou opened 11 months ago

encukou commented 11 months ago

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:

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

pitrou commented 10 months ago

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 commented 10 months ago

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 commented 10 months ago

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".