mirror of
https://github.com/python/cpython.git
synced 2025-07-29 06:05:00 +00:00
bpo-39573: Py_TYPE becomes a static inline function (GH-28128)
Convert the Py_TYPE() and Py_SIZE() macros to static inline functions. The Py_SET_TYPE() and Py_SET_SIZE() functions must now be used to set an object type and size.
This commit is contained in:
parent
4dc4300c68
commit
cb15afcccf
5 changed files with 52 additions and 9 deletions
|
@ -99,7 +99,10 @@ the definition of all other Python objects.
|
|||
|
||||
Return a :term:`borrowed reference`.
|
||||
|
||||
The :c:func:`Py_SET_TYPE` function must be used to set an object type.
|
||||
Use the :c:func:`Py_SET_TYPE` function to set an object type.
|
||||
|
||||
.. versionchanged:: 3.11
|
||||
:c:func:`Py_TYPE()` is changed to an inline static function.
|
||||
|
||||
|
||||
.. c:function:: int Py_IS_TYPE(PyObject *o, PyTypeObject *type)
|
||||
|
@ -121,9 +124,10 @@ the definition of all other Python objects.
|
|||
|
||||
Get the reference count of the Python object *o*.
|
||||
|
||||
Use the :c:func:`Py_SET_REFCNT()` function to set an object reference count.
|
||||
|
||||
.. versionchanged:: 3.10
|
||||
:c:func:`Py_REFCNT()` is changed to the inline static function.
|
||||
Use :c:func:`Py_SET_REFCNT()` to set an object reference count.
|
||||
|
||||
|
||||
.. c:function:: void Py_SET_REFCNT(PyObject *o, Py_ssize_t refcnt)
|
||||
|
@ -137,7 +141,10 @@ the definition of all other Python objects.
|
|||
|
||||
Get the size of the Python object *o*.
|
||||
|
||||
The :c:func:`Py_SET_SIZE` function must be used to set an object size.
|
||||
Use the :c:func:`Py_SET_SIZE` function to set an object size.
|
||||
|
||||
.. versionchanged:: 3.11
|
||||
:c:func:`Py_SIZE()` is changed to an inline static function.
|
||||
|
||||
|
||||
.. c:function:: void Py_SET_SIZE(PyVarObject *o, Py_ssize_t size)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue