mirror of
https://github.com/python/cpython.git
synced 2026-04-16 08:41:19 +00:00
[3.14] Document that PyType_GetModule returns a borrowed ref (GH-145612) (GH-145682)
(cherry picked from commit 44855458a4)
This commit is contained in:
parent
5b25aab02d
commit
30bcdcd379
2 changed files with 7 additions and 0 deletions
|
|
@ -274,6 +274,10 @@ Type Objects
|
|||
Return the module object associated with the given type when the type was
|
||||
created using :c:func:`PyType_FromModuleAndSpec`.
|
||||
|
||||
The returned reference is :term:`borrowed <borrowed reference>` from *type*,
|
||||
and will be valid as long as you hold a reference to *type*.
|
||||
Do not release it with :c:func:`Py_DECREF` or similar.
|
||||
|
||||
If no module is associated with the given type, sets :py:class:`TypeError`
|
||||
and returns ``NULL``.
|
||||
|
||||
|
|
|
|||
|
|
@ -2415,6 +2415,9 @@ PyType_GetFlags:PyTypeObject*:type:0:
|
|||
PyType_GetName:PyObject*::+1:
|
||||
PyType_GetName:PyTypeObject*:type:0:
|
||||
|
||||
PyType_GetModule:PyObject*::0:
|
||||
PyType_GetModule:PyTypeObject*:type:0:
|
||||
|
||||
PyType_GetModuleByDef:PyObject*::0:
|
||||
PyType_GetModuleByDef:PyTypeObject*:type:0:
|
||||
PyType_GetModuleByDef:PyModuleDef*:def::
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue