Skip to content

Commit a09f942

Browse files
committed
Add docs
1 parent 1bcaac6 commit a09f942

File tree

3 files changed

+16
-0
lines changed

3 files changed

+16
-0
lines changed

Doc/c-api/intro.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,16 @@ familiar with writing an extension before attempting to embed Python in a real
3030
application.
3131

3232

33+
Language version compatibility
34+
==============================
35+
36+
Python's C API is compatible with C11 and C++11 versions of C and C++.
37+
38+
This is a lower limit: the C API does not require features from later
39+
C/C++ versions.
40+
You do *not* need to enable your compiler's "c11 mode".
41+
42+
3343
Coding standards
3444
================
3545

Lib/test/test_cext/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@ def test_build_c11(self):
3838

3939
@unittest.skipIf(support.MS_WINDOWS, "MSVC doesn't support /std:c99")
4040
def test_build_c99(self):
41+
# In public docs, we say C API is compatible with C11. However,
42+
# in practice we do maintain C99 compatibility in public headers.
43+
# Please ask the C API WG before adding a new C11-only feature.
4144
self.check_build('_test_c99_cext', std='c99')
4245

4346
@support.requires_gil_enabled('incompatible with Free Threading')

Lib/test/test_cppext/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ def test_build(self):
2929
self.check_build('_testcppext')
3030

3131
def test_build_cpp03(self):
32+
# In public docs, we say C API is compatible with C++11. However,
33+
# in practice we do maintain C++03 compatibility in public headers.
34+
# Please ask the C API WG before adding a new C++11-only feature.
3235
self.check_build('_testcpp03ext', std='c++03')
3336

3437
@unittest.skipIf(support.MS_WINDOWS, "MSVC doesn't support /std:c++11")

0 commit comments

Comments
 (0)