Skip to content

Commit

Permalink
Bad API
Browse files Browse the repository at this point in the history
  • Loading branch information
vstinner committed Jun 20, 2023
1 parent 21ab4ca commit 1279490
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion doc/bad_api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@ Functions
* ``PyFunction_GetDefaults()``
* ``PyFunction_GetGlobals()``
* ``PyFunction_GetModule()``
* ``PyImport_AddModule()``: use ``PyImport_AddModuleRef()``
* ``PyImport_AddModuleObject()``: use ``PyImport_AddModuleRef()``
* ``PyImport_GetModuleDict()``
* ``PyInstanceMethod_Function()``
* ``PyInstanceMethod_GET_FUNCTION()``
Expand All @@ -105,7 +107,6 @@ Functions
* ``PyMethod_Self()``
* ``PyModuleDef_Init()``
* ``PyModule_GetDict()``
* ``PyObject_Init()``
* ``PySequence_Fast_GET_ITEM()``
* ``PyState_FindModule()``
* ``PyStructSequence_GET_ITEM()``
Expand All @@ -119,6 +120,11 @@ Functions
* ``PyWeakref_GetObject()``: see https://mail.python.org/pipermail/python-dev/2016-October/146604.html
* ``Py_TYPE()``: use ``PyObject_Type()``

Misc:

* ``PyObject_Init(op)`` returns *op* which is technically a borrrow reference,
see `GH-105944 issue <https://github.com/python/cpython/issues/105944>`_

Raw pointer without relase function
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Expand Down

0 comments on commit 1279490

Please sign in to comment.