Skip to content

Commit 908695b

Browse files
[3.13] gh-141004: Document PyLong_FromPid and PyLong_AsPid (GH-141028) (GH-141143)
* gh-141004: Document `PyLong_FromPid` and `PyLong_AsPid` (GH-141028) Co-authored-by: Victor Stinner <[email protected]> (cherry picked from commit bcc524f)
1 parent ccbee02 commit 908695b

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
@@ -141,6 +141,17 @@ distinguished from a number. Use :c:func:`PyErr_Occurred` to disambiguate.
141141
.. versionadded:: 3.13
142142
143143
144+
.. c:macro:: PyLong_FromPid(pid)
145+
146+
Macro for creating a Python integer from a process identifier.
147+
148+
This can be defined as an alias to :c:func:`PyLong_FromLong` or
149+
:c:func:`PyLong_FromLongLong`, depending on the size of the system's
150+
PID type.
151+
152+
.. versionadded:: 3.2
153+
154+
144155
.. c:function:: long PyLong_AsLong(PyObject *obj)
145156
146157
.. index::
@@ -369,6 +380,17 @@ distinguished from a number. Use :c:func:`PyErr_Occurred` to disambiguate.
369380
Returns ``NULL`` on error. Use :c:func:`PyErr_Occurred` to disambiguate.
370381
371382
383+
.. c:macro:: PyLong_AsPid(pid)
384+
385+
Macro for converting a Python integer into a process identifier.
386+
387+
This can be defined as an alias to :c:func:`PyLong_AsLong`,
388+
:c:func:`PyLong_FromLongLong`, or :c:func:`PyLong_AsInt`, depending on the
389+
size of the system's PID type.
390+
391+
.. versionadded:: 3.2
392+
393+
372394
.. c:function:: Py_ssize_t PyLong_AsNativeBytes(PyObject *pylong, void* buffer, Py_ssize_t n_bytes, int flags)
373395
374396
Copy the Python integer value *pylong* to a native *buffer* of size

0 commit comments

Comments
 (0)