PEP 7: Python 3.11 uses C11 (#2309)
This commit is contained in:
parent
d795805141
commit
e846b706bb
16
pep-0007.txt
16
pep-0007.txt
|
@ -31,13 +31,11 @@ particular rule:
|
||||||
C dialect
|
C dialect
|
||||||
=========
|
=========
|
||||||
|
|
||||||
* Python versions before 3.6 use ANSI/ISO standard C (the 1989 version
|
* Python 3.11 and newer versions use C11 without `optional features
|
||||||
of the standard). This means (amongst many other things) that all
|
<https://en.wikipedia.org/wiki/C11_%28C_standard_revision%29#Optional_features>`_.
|
||||||
declarations must be at the top of a block (not necessarily at the
|
The public C API should be compatible with C++.
|
||||||
top of function).
|
|
||||||
|
|
||||||
* Python versions greater than or equal to 3.6 use C89 with several
|
* Python 3.6 to 3.10 use C89 with several select C99 features:
|
||||||
select C99 features:
|
|
||||||
|
|
||||||
- Standard integer types in ``<stdint.h>`` and ``<inttypes.h>``. We
|
- Standard integer types in ``<stdint.h>`` and ``<inttypes.h>``. We
|
||||||
require the fixed width integer types.
|
require the fixed width integer types.
|
||||||
|
@ -47,8 +45,10 @@ C dialect
|
||||||
- booleans
|
- booleans
|
||||||
- C++-style line comments
|
- C++-style line comments
|
||||||
|
|
||||||
Future C99 features may be added to this list in the future
|
* Python versions before 3.6 used ANSI/ISO standard C (the 1989 version
|
||||||
depending on compiler support (mostly significantly MSVC).
|
of the standard). This meant (amongst many other things) that all
|
||||||
|
declarations must be at the top of a block (not necessarily at the
|
||||||
|
top of function).
|
||||||
|
|
||||||
* Don't use compiler-specific extensions, such as those of GCC or MSVC
|
* Don't use compiler-specific extensions, such as those of GCC or MSVC
|
||||||
(e.g. don't write multi-line strings without trailing backslashes).
|
(e.g. don't write multi-line strings without trailing backslashes).
|
||||||
|
|
Loading…
Reference in New Issue