diff options
author | Jeroen Ruigrok van der Werven <asmodai@in-nomine.org> | 2009-04-25 11:59:09 (GMT) |
---|---|---|
committer | Jeroen Ruigrok van der Werven <asmodai@in-nomine.org> | 2009-04-25 11:59:09 (GMT) |
commit | 162641a24cf2228246a9b8d5e0ca415a32444d5f (patch) | |
tree | fb23a7fb2d0c249ec7bca701551a7a7f9a5dff25 /Doc | |
parent | bc25bf9d3e784bfb97206a3b6717a496b14dfc55 (diff) | |
download | cpython-162641a24cf2228246a9b8d5e0ca415a32444d5f.zip cpython-162641a24cf2228246a9b8d5e0ca415a32444d5f.tar.gz cpython-162641a24cf2228246a9b8d5e0ca415a32444d5f.tar.bz2 |
First attempt to document PyObject_HEAD_INIT and PyVarObject_HEAD_INIT.
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/c-api/structures.rst | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/Doc/c-api/structures.rst b/Doc/c-api/structures.rst index 1655270..c4fb218 100644 --- a/Doc/c-api/structures.rst +++ b/Doc/c-api/structures.rst @@ -68,7 +68,24 @@ These macros are used in the definition of :ctype:`PyObject` and Note that :cmacro:`PyObject_HEAD` is part of the expansion, and that its own expansion varies depending on the definition of :cmacro:`Py_TRACE_REFS`. -PyObject_HEAD_INIT + +.. cmacro:: PyObject_HEAD_INIT(type) + + This is a macro which expands to initialization values for a new + :ctype:`PyObject` type. This macro expands to:: + + _PyObject_EXTRA_INIT + 1, type, + + +.. cmacro:: PyVarObject_HEAD_INIT(type, size) + + This is a macro which expands to initialization values for a new + :ctype:`PyVarObject` type, including the :attr:`ob_size` field. + This macro expands to:: + + _PyObject_EXTRA_INIT + 1, type, size, .. ctype:: PyCFunction |