]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
First attempt to document PyObject_HEAD_INIT and PyVarObject_HEAD_INIT.
authorJeroen Ruigrok van der Werven <asmodai@in-nomine.org>
Sat, 25 Apr 2009 11:59:09 +0000 (11:59 +0000)
committerJeroen Ruigrok van der Werven <asmodai@in-nomine.org>
Sat, 25 Apr 2009 11:59:09 +0000 (11:59 +0000)
Doc/c-api/structures.rst

index 16552700057d2a69a7ec3b4870bb53a083f0d1ee..c4fb218749bc26e14f617c817f2a54b544f377ed 100644 (file)
@@ -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