summaryrefslogtreecommitdiffstats
path: root/Misc
diff options
context:
space:
mode:
authorPetr Viktorin <encukou@gmail.com>2021-12-10 23:34:31 (GMT)
committerGitHub <noreply@github.com>2021-12-10 23:34:31 (GMT)
commit98e506ae8a7997658a08fbf77ac016d200588cb3 (patch)
tree6f011328ab69be1b832ed70166643df91ca6c1a0 /Misc
parent3cb357a2e6ac18ee98db5d450414e773744e3c76 (diff)
downloadcpython-98e506ae8a7997658a08fbf77ac016d200588cb3.zip
cpython-98e506ae8a7997658a08fbf77ac016d200588cb3.tar.gz
cpython-98e506ae8a7997658a08fbf77ac016d200588cb3.tar.bz2
bpo-43795: Document stable_abi.txt format and contents (GH-29956)
Also mention that removals generally aren't allowed.
Diffstat (limited to 'Misc')
-rw-r--r--Misc/stable_abi.txt40
1 files changed, 40 insertions, 0 deletions
diff --git a/Misc/stable_abi.txt b/Misc/stable_abi.txt
index 9cb210c..c4f5318 100644
--- a/Misc/stable_abi.txt
+++ b/Misc/stable_abi.txt
@@ -10,6 +10,46 @@
# and PC/pythonXYstub.def
+# The current format is a simple line-based one with significant indentation.
+# Anything after a hash is a comment.
+
+# There are these kinds of top-level "items":
+# - struct: A C struct. Currently this file does not distinguish between:
+# - opaque structs, which the Limited API only handles via pointers
+# (so these can change at any time)
+# - structs where only certain members are part of the stable ABI (e.g.
+# PyObject)
+# - structs which must not be changed at all (e.g. PyType_Slot, which is
+# fully defined and used in arrays)
+# - function: A function that must be kept available (and exported, i.e. not
+# converted to a macro).
+# - const: A simple value, defined with `#define`.
+# - macro: A preprocessor macro more complex than a simple `const` value.
+# - data: An exported object, which must continue to be available but its exact
+# value may change.
+# - typedef: A C typedef which is used in other definitions in the limited API.
+# Its size/layout/signature must not change.
+
+# Each top-level item can have details defined below it:
+# - added: The version in which the item was added to the stable ABI.
+# - ifdef: A feature macro: the item is only available if this macro is defined
+# - abi_only: If present, the item is not part of the Limited API, but it *is*
+# part of the stable ABI. The item will not show up in user-facing docs.
+# Typically used for:
+# - private functions called by public macros, e.g. _Py_BuildValue_SizeT
+# - items that were part of the limited API in the past, and must remain part
+# of the stable ABI.
+# - a combination of the above (functions that were called by macros that
+# were public in the past)
+
+# Removing items from this file is generally not allowed, and additions should
+# be considered with that in mind. See the devguide for exact rules:
+# https://devguide.python.org/c-api/#limited-api
+
+# User-facing docs are at:
+# https://docs.python.org/3/c-api/stable.html#stable
+
+
# Mentioned in PEP 384:
struct PyObject