[Python-checkins] cpython: Issue #14424: Document PyType_GenericAlloc, and fix the documentation of

eli.bendersky python-checkins at python.org
Sun Jun 3 05:48:00 CEST 2012


http://hg.python.org/cpython/rev/3c43be281196
changeset:   77314:3c43be281196
user:        Eli Bendersky <eliben at gmail.com>
date:        Sun Jun 03 06:47:53 2012 +0300
summary:
  Issue #14424: Document PyType_GenericAlloc, and fix the documentation of PyType_GenericNew

files:
  Doc/c-api/type.rst |  9 +++++----
  1 files changed, 5 insertions(+), 4 deletions(-)


diff --git a/Doc/c-api/type.rst b/Doc/c-api/type.rst
--- a/Doc/c-api/type.rst
+++ b/Doc/c-api/type.rst
@@ -70,13 +70,14 @@
 
 .. c:function:: PyObject* PyType_GenericAlloc(PyTypeObject *type, Py_ssize_t nitems)
 
-   XXX: Document.
-
+   Generic handler for the :attr:`tp_alloc` slot of a type object.  Use
+   Python's default memory allocation mechanism to allocate a new instance and
+   initialize all its contents to *NULL*.
 
 .. c:function:: PyObject* PyType_GenericNew(PyTypeObject *type, PyObject *args, PyObject *kwds)
 
-   Generic handler for the :attr:`tp_new` slot of a type object.  Initialize
-   all instance variables to *NULL*.
+   Generic handler for the :attr:`tp_new` slot of a type object.  Create a
+   new instance using the type's :attr:`tp_alloc` slot.
 
 .. c:function:: int PyType_Ready(PyTypeObject *type)
 

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list