cpython: 63183596db79 (original) (raw)
Mercurial > cpython
changeset 100048:63183596db79 2.7
Per issue21949 and issue1629: Document the Py_SIZE, Py_TYPE, Py_REFCNT macros. This was already done in the 3.5 branch; this just does the same in the 2.7 branch. [#21949]
Gregory P. Smith greg@krypto.org | |
---|---|
date | Fri, 22 Jan 2016 13:17:41 -0800 |
parents | 9e13d97ceca2 |
children | 72edb81e456b |
files | Doc/c-api/structures.rst |
diffstat | 1 files changed, 31 insertions(+), 0 deletions(-)[+] [-] Doc/c-api/structures.rst 31 |
line wrap: on
line diff
--- a/Doc/c-api/structures.rst
+++ b/Doc/c-api/structures.rst
@@ -69,6 +69,37 @@ These macros are used in the definition
expansion varies depending on the definition of :c:macro:Py_TRACE_REFS
.
+.. c:macro:: Py_TYPE(o)
+
- This macro is used to access the :attr:
ob_type
member of a Python object. - It expands to:: +
(((PyObject*)(o))->ob_type)[](#l1.12)
+ +.. c:macro:: Py_REFCNT(o) +
- This macro is used to access the :attr:
ob_refcnt
member of a Python - object.
- It expands to:: +
(((PyObject*)(o))->ob_refcnt)[](#l1.23)
- This macro is used to access the :attr:
ob_size
member of a Python object. - It expands to:: +
(((PyVarObject*)(o))->ob_size)[](#l1.33)
+ .. c:macro:: PyObject_HEAD_INIT(type) This is a macro which expands to initialization values for a new