@@ -11,6 +11,51 @@ interpreter and to functions that interact strongly with the interpreter. It is
1111always available. Unless explicitly noted otherwise, all variables are read-only.
1212
1313
14+ .. data :: abi_info
15+
16+ .. versionadded :: next
17+
18+ An object containing information about the ABI of the currently running
19+ Python interpreter.
20+ It should include information that affect the CPython ABI in ways that
21+ require a specific build of the interpreter chosen from variants that can
22+ co-exist on a single machine.
23+ For example, it does not encode the base OS (Linux or Windows), but does
24+ include pointer size since some systems support both 32- and 64-bit builds.
25+ The available entries are the same on all platforms;
26+ e.g. *pointer_size * is available even on 64-bit-only architectures.
27+
28+ The following attributes are available:
29+
30+ .. attribute :: abi_info.pointer_bits
31+
32+ The width of pointers in bits, as an integer,
33+ equivalent to ``8 * sizeof(void *) ``.
34+ Usually, this is ``32 `` or ``64 ``.
35+
36+ .. attribute :: abi_info.free_threaded
37+
38+ A Boolean indicating whether the interpreter was built with
39+ :term: `free threading ` support.
40+ This reflects either the presence of the :option: `--disable-gil `
41+ :file: `configure ` option (on Unix)
42+ or setting the ``DisableGil `` property (on Windows).
43+
44+ .. attribute :: abi_info.debug
45+
46+ A Boolean indicating whether the interpreter was built in
47+ :ref: `debug mode <debug-build >`.
48+ This reflects either the presence of the :option: `--with-pydebug `
49+ :file: `configure ` option (on Unix)
50+ or the ``Debug `` configuration (on Windows).
51+
52+ .. attribute :: abi_info.byteorder
53+
54+ A string indicating the native byte order,
55+ either ``'big' `` or ``'little' ``.
56+ This is the same as the :data: `byteorder ` attribute.
57+
58+
1459.. data :: abiflags
1560
1661 On POSIX systems where Python was built with the standard ``configure ``
@@ -523,8 +568,9 @@ always available. Unless explicitly noted otherwise, all variables are read-only
523568
524569 Since :func: `exit ` ultimately "only" raises an exception, it will only exit
525570 the process when called from the main thread, and the exception is not
526- intercepted. Cleanup actions specified by finally clauses of :keyword: `try ` statements
527- are honored, and it is possible to intercept the exit attempt at an outer level.
571+ intercepted. Cleanup actions specified by :keyword: `finally ` clauses of
572+ :keyword: `try ` statements are honored, and it is possible to intercept the
573+ exit attempt at an outer level.
528574
529575 .. versionchanged :: 3.6
530576 If an error occurs in the cleanup after the Python interpreter
0 commit comments