Skip to content

Commit 5f7a49a

Browse files
[3.13] gh-141004: Document old provisional names for vectorcall/code API (GH-143568) (GH-143829)
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. (cherry picked from commit 7e8a1b5) Co-authored-by: Petr Viktorin <encukou@gmail.com>
1 parent 7760775 commit 5f7a49a

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
@@ -294,6 +295,9 @@ These functions are part of the unstable C API tier:
294295
this functionality is a CPython implementation detail, and the API
295296
may change without deprecation warnings.
296297
298+
.. c:function:: Py_ssize_t _PyEval_RequestCodeExtraIndex(freefunc free)
299+
:no-typesetting:
300+
297301
.. c:function:: Py_ssize_t PyUnstable_Eval_RequestCodeExtraIndex(freefunc free)
298302
299303
Return a new opaque index value used to adding data to code objects.
@@ -306,8 +310,6 @@ may change without deprecation warnings.
306310
*free* will be called on non-``NULL`` data stored under the new index.
307311
Use :c:func:`Py_DecRef` when storing :c:type:`PyObject`.
308312
309-
.. index:: single: _PyEval_RequestCodeExtraIndex (C function)
310-
311313
.. versionadded:: 3.6 as ``_PyEval_RequestCodeExtraIndex``
312314
313315
.. versionchanged:: 3.12
@@ -316,6 +318,9 @@ may change without deprecation warnings.
316318
The old private name is deprecated, but will be available until the API
317319
changes.
318320
321+
.. c:function:: int _PyCode_GetExtra(PyObject *code, Py_ssize_t index, void **extra)
322+
:no-typesetting:
323+
319324
.. c:function:: int PyUnstable_Code_GetExtra(PyObject *code, Py_ssize_t index, void **extra)
320325
321326
Set *extra* to the extra data stored under the given index.
@@ -324,8 +329,6 @@ may change without deprecation warnings.
324329
If no data was set under the index, set *extra* to ``NULL`` and return
325330
0 without setting an exception.
326331
327-
.. index:: single: _PyCode_GetExtra (C function)
328-
329332
.. versionadded:: 3.6 as ``_PyCode_GetExtra``
330333
331334
.. versionchanged:: 3.12
@@ -334,13 +337,14 @@ may change without deprecation warnings.
334337
The old private name is deprecated, but will be available until the API
335338
changes.
336339
340+
.. c:function:: int _PyCode_SetExtra(PyObject *code, Py_ssize_t index, void *extra)
341+
:no-typesetting:
342+
337343
.. c:function:: int PyUnstable_Code_SetExtra(PyObject *code, Py_ssize_t index, void *extra)
338344
339345
Set the extra data stored under the given index to *extra*.
340346
Return 0 on success. Set an exception and return -1 on failure.
341347
342-
.. index:: single: _PyCode_SetExtra (C function)
343-
344348
.. versionadded:: 3.6 as ``_PyCode_SetExtra``
345349
346350
.. versionchanged:: 3.12

Doc/c-api/typeobj.rst

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

12901290

1291+
.. c:macro:: _Py_TPFLAGS_HAVE_VECTORCALL
1292+
:no-typesetting:
1293+
12911294
.. c:macro:: Py_TPFLAGS_HAVE_VECTORCALL
12921295
12931296
This bit is set when the class implements
@@ -1299,7 +1302,12 @@ and :c:data:`PyType_Type` effectively act as defaults.)
12991302
This bit is inherited if :c:member:`~PyTypeObject.tp_call` is also
13001303
inherited.
13011304

1302-
.. versionadded:: 3.9
1305+
.. versionadded:: 3.8 as ``_Py_TPFLAGS_HAVE_VECTORCALL``
1306+
1307+
.. versionchanged:: 3.9
1308+
1309+
Renamed to the current name, without the leading underscore.
1310+
The old provisional name is :term:`soft deprecated`.
13031311

13041312
.. versionchanged:: 3.12
13051313

0 commit comments

Comments
 (0)