mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
bpo-39573: Convert Py_TYPE() and Py_SIZE() back to macros (GH-23366)
This change partically reverts commitad3252bad9
and the commitfe2978b3b9
. Many third party C extension modules rely on the ability of using Py_TYPE() to set an object type: "Py_TYPE(obj) = type;" or to set an object type using: "Py_SIZE(obj) = size;".
This commit is contained in:
parent
2156d964a1
commit
0e2ac21dd4
5 changed files with 35 additions and 26 deletions
|
@ -68,9 +68,7 @@ the definition of all other Python objects.
|
|||
|
||||
Return a :term:`borrowed reference`.
|
||||
|
||||
.. versionchanged:: 3.10
|
||||
:c:func:`Py_TYPE()` is changed to the inline static function.
|
||||
Use :c:func:`Py_SET_TYPE()` to set an object type.
|
||||
The :c:func:`Py_SET_TYPE` function must be used to set an object type.
|
||||
|
||||
|
||||
.. c:function:: int Py_IS_TYPE(PyObject *o, PyTypeObject *type)
|
||||
|
@ -108,9 +106,7 @@ the definition of all other Python objects.
|
|||
|
||||
Get the size of the Python object *o*.
|
||||
|
||||
.. versionchanged:: 3.10
|
||||
:c:func:`Py_SIZE()` is changed to the inline static function.
|
||||
Use :c:func:`Py_SET_SIZE()` to set an object size.
|
||||
The :c:func:`Py_SET_SIZE` function must be used to set an object size.
|
||||
|
||||
|
||||
.. c:function:: void Py_SET_SIZE(PyVarObject *o, Py_ssize_t size)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue