PEP 670: List converted macros (#2120)
Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>
This commit is contained in:
parent
9afa9ee0b6
commit
6f1fe98031
62
pep-0670.rst
62
pep-0670.rst
|
@ -284,6 +284,68 @@ single long line. Inside the function, the *op* argument has a well
|
|||
defined type: ``PyObject*``.
|
||||
|
||||
|
||||
Macros converted to functions since Python 3.8
|
||||
==============================================
|
||||
|
||||
Macros converted to static inline functions
|
||||
-------------------------------------------
|
||||
|
||||
Python 3.8:
|
||||
|
||||
* ``Py_DECREF()``
|
||||
* ``Py_INCREF()``
|
||||
* ``Py_XDECREF()``
|
||||
* ``Py_XINCREF()``
|
||||
* ``PyObject_INIT()``
|
||||
* ``PyObject_INIT_VAR()``
|
||||
* ``_PyObject_GC_UNTRACK()``
|
||||
* ``_Py_Dealloc()``
|
||||
|
||||
Python 3.10:
|
||||
|
||||
* ``Py_REFCNT()``
|
||||
|
||||
Python 3.11:
|
||||
|
||||
* ``Py_TYPE()``
|
||||
* ``Py_SIZE()``
|
||||
|
||||
Macros converted to regular functions
|
||||
-------------------------------------
|
||||
|
||||
Python 3.9:
|
||||
|
||||
* ``PyIndex_Check()``
|
||||
* ``PyObject_CheckBuffer()``
|
||||
* ``PyObject_GET_WEAKREFS_LISTPTR()``
|
||||
* ``PyObject_IS_GC()``
|
||||
* ``PyObject_NEW()``: alias to ``PyObject_New()``
|
||||
* ``PyObject_NEW_VAR()``: alias to ``PyObjectVar_New()``
|
||||
|
||||
To avoid any risk of performance slowdown on Python built without LTO,
|
||||
private static inline functions have been added to the internal C API:
|
||||
|
||||
* ``_PyIndex_Check()``
|
||||
* ``_PyObject_IS_GC()``
|
||||
* ``_PyType_HasFeature()``
|
||||
* ``_PyType_IS_GC()``
|
||||
|
||||
Static inline functions converted to regular functions
|
||||
-------------------------------------------------------
|
||||
|
||||
Python 3.11:
|
||||
|
||||
* ``PyObject_CallOneArg()``
|
||||
* ``PyObject_Vectorcall()``
|
||||
* ``PyVectorcall_Function()``
|
||||
* ``_PyObject_FastCall()``
|
||||
|
||||
To avoid any risk of performance slowdown on Python built without LTO, a
|
||||
private static inline function has been added to the internal C API:
|
||||
|
||||
* ``_PyVectorcall_FunctionInline()``
|
||||
|
||||
|
||||
References
|
||||
==========
|
||||
|
||||
|
|
Loading…
Reference in New Issue