Skip to content

Commit 7e8a1b5

Browse files
authored
gh-141004: Document old provisional names for vectorcall/code API (GH-143568)
gh-141004: Document old provisional names for vectorcall & code API For vectorcall API, the underscore-prefixed provisional names continue to be available per PEP 590: https://peps.python.org/pep-0590/#finalizing-the-api Use `versionadded`, `versionchanged`, and `:no-typesetting:` to mark this up. For PyCode API, use `:no-typesetting:` rather than `index::` so that these are semantically documented as C functions.
1 parent 1857a40 commit 7e8a1b5

File tree

3 files changed

+29
-10
lines changed

3 files changed

+29
-10
lines changed

Doc/c-api/call.rst

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,6 +347,8 @@ please see individual documentation for details.
347347
348348
.. versionadded:: 3.9
349349
350+
.. c:function:: PyObject* _PyObject_Vectorcall(PyObject *callable, PyObject *const *args, size_t nargsf, PyObject *kwnames)
351+
:no-typesetting:
350352
351353
.. c:function:: PyObject* PyObject_Vectorcall(PyObject *callable, PyObject *const *args, size_t nargsf, PyObject *kwnames)
352354
@@ -358,7 +360,12 @@ please see individual documentation for details.
358360
Return the result of the call on success, or raise an exception and return
359361
*NULL* on failure.
360362
361-
.. versionadded:: 3.9
363+
.. versionadded:: 3.8 as ``_PyObject_Vectorcall``
364+
365+
.. versionchanged:: 3.9
366+
367+
Renamed to the current name, without the leading underscore.
368+
The old provisional name is :term:`soft deprecated`.
362369
363370
.. c:function:: PyObject* PyObject_VectorcallDict(PyObject *callable, PyObject *const *args, size_t nargsf, PyObject *kwdict)
364371

Doc/c-api/code.rst

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -69,13 +69,14 @@ bound into a function.
6969
The old name is deprecated, but will remain available until the
7070
signature changes again.
7171
72+
.. c:function:: PyCodeObject* PyCode_NewWithPosOnlyArgs(...)
73+
:no-typesetting:
74+
7275
.. c:function:: PyCodeObject* PyUnstable_Code_NewWithPosOnlyArgs(int argcount, int posonlyargcount, int kwonlyargcount, int nlocals, int stacksize, int flags, PyObject *code, PyObject *consts, PyObject *names, PyObject *varnames, PyObject *freevars, PyObject *cellvars, PyObject *filename, PyObject *name, PyObject *qualname, int firstlineno, PyObject *linetable, PyObject *exceptiontable)
7376
7477
Similar to :c:func:`PyUnstable_Code_New`, but with an extra "posonlyargcount" for positional-only arguments.
7578
The same caveats that apply to ``PyUnstable_Code_New`` also apply to this function.
7679
77-
.. index:: single: PyCode_NewWithPosOnlyArgs (C function)
78-
7980
.. versionadded:: 3.8 as ``PyCode_NewWithPosOnlyArgs``
8081
8182
.. versionchanged:: 3.11
@@ -298,6 +299,9 @@ These functions are part of the unstable C API tier:
298299
this functionality is a CPython implementation detail, and the API
299300
may change without deprecation warnings.
300301
302+
.. c:function:: Py_ssize_t _PyEval_RequestCodeExtraIndex(freefunc free)
303+
:no-typesetting:
304+
301305
.. c:function:: Py_ssize_t PyUnstable_Eval_RequestCodeExtraIndex(freefunc free)
302306
303307
Return a new opaque index value used to adding data to code objects.
@@ -310,8 +314,6 @@ may change without deprecation warnings.
310314
*free* will be called on non-``NULL`` data stored under the new index.
311315
Use :c:func:`Py_DecRef` when storing :c:type:`PyObject`.
312316
313-
.. index:: single: _PyEval_RequestCodeExtraIndex (C function)
314-
315317
.. versionadded:: 3.6 as ``_PyEval_RequestCodeExtraIndex``
316318
317319
.. versionchanged:: 3.12
@@ -320,6 +322,9 @@ may change without deprecation warnings.
320322
The old private name is deprecated, but will be available until the API
321323
changes.
322324
325+
.. c:function:: int _PyCode_GetExtra(PyObject *code, Py_ssize_t index, void **extra)
326+
:no-typesetting:
327+
323328
.. c:function:: int PyUnstable_Code_GetExtra(PyObject *code, Py_ssize_t index, void **extra)
324329
325330
Set *extra* to the extra data stored under the given index.
@@ -328,8 +333,6 @@ may change without deprecation warnings.
328333
If no data was set under the index, set *extra* to ``NULL`` and return
329334
0 without setting an exception.
330335
331-
.. index:: single: _PyCode_GetExtra (C function)
332-
333336
.. versionadded:: 3.6 as ``_PyCode_GetExtra``
334337
335338
.. versionchanged:: 3.12
@@ -338,13 +341,14 @@ may change without deprecation warnings.
338341
The old private name is deprecated, but will be available until the API
339342
changes.
340343
344+
.. c:function:: int _PyCode_SetExtra(PyObject *code, Py_ssize_t index, void *extra)
345+
:no-typesetting:
346+
341347
.. c:function:: int PyUnstable_Code_SetExtra(PyObject *code, Py_ssize_t index, void *extra)
342348
343349
Set the extra data stored under the given index to *extra*.
344350
Return 0 on success. Set an exception and return -1 on failure.
345351
346-
.. index:: single: _PyCode_SetExtra (C function)
347-
348352
.. versionadded:: 3.6 as ``_PyCode_SetExtra``
349353
350354
.. versionchanged:: 3.12

Doc/c-api/typeobj.rst

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1373,6 +1373,9 @@ and :c:data:`PyType_Type` effectively act as defaults.)
13731373
type structure.
13741374

13751375

1376+
.. c:macro:: _Py_TPFLAGS_HAVE_VECTORCALL
1377+
:no-typesetting:
1378+
13761379
.. c:macro:: Py_TPFLAGS_HAVE_VECTORCALL
13771380
13781381
This bit is set when the class implements
@@ -1384,7 +1387,12 @@ and :c:data:`PyType_Type` effectively act as defaults.)
13841387
This bit is inherited if :c:member:`~PyTypeObject.tp_call` is also
13851388
inherited.
13861389

1387-
.. versionadded:: 3.9
1390+
.. versionadded:: 3.8 as ``_Py_TPFLAGS_HAVE_VECTORCALL``
1391+
1392+
.. versionchanged:: 3.9
1393+
1394+
Renamed to the current name, without the leading underscore.
1395+
The old provisional name is :term:`soft deprecated`.
13881396

13891397
.. versionchanged:: 3.12
13901398

0 commit comments

Comments
 (0)