Skip to content

Commit bcc524f

Browse files
gh-141004: Document PyLong_FromPid and PyLong_AsPid (GH-141028)
Co-authored-by: Victor Stinner <vstinner@python.org>
1 parent 54110e2 commit bcc524f

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

Doc/c-api/long.rst

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,17 @@ distinguished from a number. Use :c:func:`PyErr_Occurred` to disambiguate.
161161
.. versionadded:: 3.13
162162
163163
164+
.. c:macro:: PyLong_FromPid(pid)
165+
166+
Macro for creating a Python integer from a process identifier.
167+
168+
This can be defined as an alias to :c:func:`PyLong_FromLong` or
169+
:c:func:`PyLong_FromLongLong`, depending on the size of the system's
170+
PID type.
171+
172+
.. versionadded:: 3.2
173+
174+
164175
.. c:function:: long PyLong_AsLong(PyObject *obj)
165176
166177
.. index::
@@ -575,6 +586,17 @@ distinguished from a number. Use :c:func:`PyErr_Occurred` to disambiguate.
575586
.. versionadded:: 3.13
576587
577588
589+
.. c:macro:: PyLong_AsPid(pid)
590+
591+
Macro for converting a Python integer into a process identifier.
592+
593+
This can be defined as an alias to :c:func:`PyLong_AsLong`,
594+
:c:func:`PyLong_FromLongLong`, or :c:func:`PyLong_AsInt`, depending on the
595+
size of the system's PID type.
596+
597+
.. versionadded:: 3.2
598+
599+
578600
.. c:function:: int PyLong_GetSign(PyObject *obj, int *sign)
579601
580602
Get the sign of the integer object *obj*.

0 commit comments

Comments
 (0)