[Python-checkins] r71874 - python/trunk/Doc/c-api/structures.rst
jeroen.ruigrok
python-checkins at python.org
Sat Apr 25 13:59:09 CEST 2009
Author: jeroen.ruigrok
Date: Sat Apr 25 13:59:09 2009
New Revision: 71874
Log:
First attempt to document PyObject_HEAD_INIT and PyVarObject_HEAD_INIT.
Modified:
python/trunk/Doc/c-api/structures.rst
Modified: python/trunk/Doc/c-api/structures.rst
==============================================================================
--- python/trunk/Doc/c-api/structures.rst (original)
+++ python/trunk/Doc/c-api/structures.rst Sat Apr 25 13:59:09 2009
@@ -68,7 +68,24 @@
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
More information about the Python-checkins
mailing list