Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 11cfea9

Browse files
committed
Issue #14424: Document PyType_GenericAlloc, and fix the documentation of PyType_GenericNew
1 parent c68e136 commit 11cfea9

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

Doc/c-api/type.rst

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,13 +70,14 @@ Type Objects
7070
7171
.. c:function:: PyObject* PyType_GenericAlloc(PyTypeObject *type, Py_ssize_t nitems)
7272
73-
XXX: Document.
74-
73+
Generic handler for the :attr:`tp_alloc` slot of a type object. Use
74+
Python's default memory allocation mechanism to allocate a new instance and
75+
initialize all its contents to *NULL*.
7576
7677
.. c:function:: PyObject* PyType_GenericNew(PyTypeObject *type, PyObject *args, PyObject *kwds)
7778
78-
Generic handler for the :attr:`tp_new` slot of a type object. Initialize
79-
all instance variables to *NULL*.
79+
Generic handler for the :attr:`tp_new` slot of a type object. Create a
80+
new instance using the type's :attr:`tp_alloc` slot.
8081
8182
.. c:function:: int PyType_Ready(PyTypeObject *type)
8283

0 commit comments

Comments
 (0)