Skip to content

C standard #22

Open
Open

Description

@encukou

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)

Activity

  1. added
    guideline
    on Oct 11, 2023
  2. pitrou commented on Oct 14, 2023

    @pitrou

    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.

  3. gpshead commented on Oct 26, 2023

    @gpshead

    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.

  4. pitrou commented on Oct 26, 2023

    @pitrou

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    guideline

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions