You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
According to PEP 7 -- the style guide (!) -- public Python headers are compatible with C99 and (some version of) C++.
That is arguably not strict enough, and it's definitely untested.
In practice, I'm trying to keep it compatible with ISO C89, since some projects require explicitly C89, likely for historical reasons (maybe to detect build failures on old Visual Studio versions). I could fight to enforce C99 or C11, but in practice, it's cheap to fix the very low number of C89 issues. Usually, it's just about declaring variables at the top of static inline functions.
Also, if almost the whole API become just a list of declaration of opaque functions, the C standard is not really a big deal anymore (maybe just for <stdint.h> types, like int64_t, or ssize_t) :-)
Note: Recently, I started to care about the C++ standard as well, since Python C API is used in C++ (ex: pybind11) and converting macros to static inline functions created new funny issues.
According to PEP 7 -- the style guide (!) -- public Python headers are compatible with C99 and (some version of) C++.
That is arguably not strict enough, and it's definitely untested.
See discussion in https://discuss.python.org/t/26481
The text was updated successfully, but these errors were encountered: