]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-141004: Document `PyLong_FromPid` and `PyLong_AsPid` (GH-141028)
authorPeter Bierma <zintensitydev@gmail.com>
Thu, 6 Nov 2025 14:01:48 +0000 (09:01 -0500)
committerGitHub <noreply@github.com>
Thu, 6 Nov 2025 14:01:48 +0000 (09:01 -0500)
Co-authored-by: Victor Stinner <vstinner@python.org>
Doc/c-api/long.rst

index fcb20f7c93cbccf9dfddcfabfb4cad7764af8821..ed34efe716d8b954aa1a64cc24b6d70e2fcb594a 100644 (file)
@@ -161,6 +161,17 @@ distinguished from a number.  Use :c:func:`PyErr_Occurred` to disambiguate.
    .. versionadded:: 3.13
 
 
+.. c:macro:: PyLong_FromPid(pid)
+
+   Macro for creating a Python integer from a process identifier.
+
+   This can be defined as an alias to :c:func:`PyLong_FromLong` or
+   :c:func:`PyLong_FromLongLong`, depending on the size of the system's
+   PID type.
+
+   .. versionadded:: 3.2
+
+
 .. c:function:: long PyLong_AsLong(PyObject *obj)
 
    .. index::
@@ -575,6 +586,17 @@ distinguished from a number.  Use :c:func:`PyErr_Occurred` to disambiguate.
    .. versionadded:: 3.13
 
 
+.. c:macro:: PyLong_AsPid(pid)
+
+   Macro for converting a Python integer into a process identifier.
+
+   This can be defined as an alias to :c:func:`PyLong_AsLong`,
+   :c:func:`PyLong_FromLongLong`, or :c:func:`PyLong_AsInt`, depending on the
+   size of the system's PID type.
+
+   .. versionadded:: 3.2
+
+
 .. c:function:: int PyLong_GetSign(PyObject *obj, int *sign)
 
    Get the sign of the integer object *obj*.