gh-101101: Unstable C API tier (PEP 689) (GH-101102)

This commit is contained in:
Petr Viktorin 2023-02-28 09:31:01 +01:00 committed by GitHub
parent c41af812c9
commit 6b2d7c0ddb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
18 changed files with 358 additions and 29 deletions

View file

@ -143,6 +143,22 @@ class Annotations:
' (Only some members are part of the stable ABI.)')
node.insert(0, emph_node)
# Unstable API annotation.
if name.startswith('PyUnstable'):
warn_node = nodes.admonition(
classes=['unstable-c-api', 'warning'])
message = 'This is '
emph_node = nodes.emphasis(message, message)
ref_node = addnodes.pending_xref(
'Unstable API', refdomain="std",
reftarget='unstable-c-api',
reftype='ref', refexplicit="False")
ref_node += nodes.Text('Unstable API')
emph_node += ref_node
emph_node += nodes.Text('. It may change without warning in minor releases.')
warn_node += emph_node
node.insert(0, warn_node)
# Return value annotation
if objtype != 'function':
continue