@@ -181,12 +181,14 @@ Type Objects
181181 before initialization) and should be paired with :c:func:`PyObject_Free` in
182182 :c:member:`~PyTypeObject.tp_free`.
183183
184+
184185.. c:function:: PyObject* PyType_GenericNew(PyTypeObject *type, PyObject *args, PyObject *kwds)
185186
186187 Generic handler for the :c:member: `~PyTypeObject.tp_new ` slot of a type
187188 object. Creates a new instance using the type's
188189 :c:member: `~PyTypeObject.tp_alloc ` slot and returns the resulting object.
189190
191+
190192.. c :function :: int PyType_Ready (PyTypeObject *type)
191193
192194 Finalize a type object. This should be called on all type objects to finish
@@ -203,13 +205,15 @@ Type Objects
203205 GC protocol itself by at least implementing the
204206 :c:member: `~PyTypeObject.tp_traverse ` handle.
205207
208+
206209.. c :function :: PyObject* PyType_GetName (PyTypeObject *type)
207210
208211 Return the type's name. Equivalent to getting the type's
209212 :attr: `~type.__name__ ` attribute.
210213
211214 .. versionadded :: 3.11
212215
216+
213217.. c :function :: PyObject* PyType_GetQualName (PyTypeObject *type)
214218
215219 Return the type's qualified name. Equivalent to getting the
@@ -225,13 +229,15 @@ Type Objects
225229
226230 .. versionadded :: 3.13
227231
232+
228233.. c :function :: PyObject* PyType_GetModuleName (PyTypeObject *type)
229234
230235 Return the type's module name. Equivalent to getting the
231236 :attr: `type.__module__ ` attribute.
232237
233238 .. versionadded :: 3.13
234239
240+
235241.. c :function :: void * PyType_GetSlot (PyTypeObject *type, int slot)
236242
237243 Return the function pointer stored in the given slot. If the
@@ -248,6 +254,7 @@ Type Objects
248254 :c:func: `PyType_GetSlot ` can now accept all types.
249255 Previously, it was limited to :ref: `heap types <heap-types >`.
250256
257+
251258.. c :function :: PyObject* PyType_GetModule (PyTypeObject *type)
252259
253260 Return the module object associated with the given type when the type was
@@ -267,6 +274,7 @@ Type Objects
267274
268275 .. versionadded :: 3.9
269276
277+
270278.. c :function :: void * PyType_GetModuleState (PyTypeObject *type)
271279
272280 Return the state of the module object associated with the given type.
@@ -281,6 +289,7 @@ Type Objects
281289
282290 .. versionadded :: 3.9
283291
292+
284293.. c :function :: PyObject* PyType_GetModuleByDef (PyTypeObject *type, struct PyModuleDef *def)
285294
286295 Find the first superclass whose module was created from
@@ -300,6 +309,7 @@ Type Objects
300309
301310 .. versionadded:: 3.11
302311
312+
303313.. c:function:: int PyType_GetBaseByToken(PyTypeObject *type, void *token, PyTypeObject **result)
304314
305315 Find the first superclass in *type *'s :term: `method resolution order ` whose
@@ -318,6 +328,7 @@ Type Objects
318328
319329 .. versionadded :: 3.14
320330
331+
321332.. c :function :: int PyUnstable_Type_AssignVersionTag (PyTypeObject *type)
322333
323334 Attempt to assign a version tag to the given type.
@@ -327,6 +338,7 @@ Type Objects
327338
328339 .. versionadded :: 3.12
329340
341+
330342.. c :function :: int PyType_SUPPORTS_WEAKREFS (PyTypeObject *type)
331343
332344 Return true if instances of *type * supports creating weak references, false
@@ -336,6 +348,7 @@ Type Objects
336348 * :ref: `weakrefobjects `
337349 * :py:mod: `weakref `
338350
351+
339352Creating Heap-Allocated Types
340353.............................
341354
@@ -384,6 +397,7 @@ The following functions and structs are used to create
384397
385398 .. versionadded:: 3.12
386399
400+
387401.. c:function:: PyObject* PyType_FromModuleAndSpec(PyObject *module, PyType_Spec *spec, PyObject *bases)
388402
389403 Equivalent to ``PyType_FromMetaclass(NULL, module, spec, bases) ``.
@@ -410,6 +424,7 @@ The following functions and structs are used to create
410424 Creating classes whose metaclass overrides
411425 :c:member: `~PyTypeObject.tp_new ` is no longer allowed.
412426
427+
413428.. c :function :: PyObject* PyType_FromSpecWithBases (PyType_Spec *spec, PyObject *bases)
414429
415430 Equivalent to ``PyType_FromMetaclass(NULL, NULL, spec, bases) ``.
@@ -431,6 +446,7 @@ The following functions and structs are used to create
431446 Creating classes whose metaclass overrides
432447 :c:member: `~PyTypeObject.tp_new ` is no longer allowed.
433448
449+
434450.. c :function :: PyObject* PyType_FromSpec (PyType_Spec *spec)
435451
436452 Equivalent to ``PyType_FromMetaclass(NULL, NULL, spec, NULL) ``.
@@ -451,6 +467,7 @@ The following functions and structs are used to create
451467 Creating classes whose metaclass overrides
452468 :c:member: `~PyTypeObject.tp_new ` is no longer allowed.
453469
470+
454471.. c :function :: int PyType_Freeze (PyTypeObject *type)
455472
456473 Make a type immutable: set the :c:macro: `Py_TPFLAGS_IMMUTABLETYPE ` flag.
@@ -622,6 +639,7 @@ The following functions and structs are used to create
622639 * :c:data:`Py_tp_token` (for clarity, prefer :c:data: `Py_TP_USE_SPEC `
623640 rather than ``NULL ``)
624641
642+
625643.. c:macro:: Py_tp_token
626644
627645 A :c:member:`~PyType_Slot.slot` that records a static memory layout ID
0 commit comments