https://github.com/python/cpython/commit/bcc524f82d8548707046ce90f5bc56f60018767a
commit: bcc524f82d8548707046ce90f5bc56f60018767a
branch: main
author: Peter Bierma <[email protected]>
committer: ZeroIntensity <[email protected]>
date: 2025-11-06T09:01:48-05:00
summary:

gh-141004: Document `PyLong_FromPid` and `PyLong_AsPid` (GH-141028)

Co-authored-by: Victor Stinner <[email protected]>

files:
M Doc/c-api/long.rst

diff --git a/Doc/c-api/long.rst b/Doc/c-api/long.rst
index fcb20f7c93cbcc..ed34efe716d8b9 100644
--- a/Doc/c-api/long.rst
+++ b/Doc/c-api/long.rst
@@ -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*.

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3//lists/python-checkins.python.org
Member address: [email protected]

Reply via email to