summaryrefslogtreecommitdiffstats
path: root/Doc/c-api/long.rst
diff options
context:
space:
mode:
Diffstat (limited to 'Doc/c-api/long.rst')
-rw-r--r--Doc/c-api/long.rst11
1 files changed, 7 insertions, 4 deletions
diff --git a/Doc/c-api/long.rst b/Doc/c-api/long.rst
index 19d65b8..083fe8b 100644
--- a/Doc/c-api/long.rst
+++ b/Doc/c-api/long.rst
@@ -121,10 +121,13 @@ All integers are implemented as "long" integer objects of arbitrary size.
.. cfunction:: long PyLong_AsLongAndOverflow(PyObject *pylong, int* overflow)
- Return a C :ctype:`long` representation of the contents of *pylong*. If
- *pylong* is greater than :const:`LONG_MAX`, return -1 and
- set `*overflow` to 1 (for overflow) or -1 (for underflow).
- If an exception is set because of type errors, also return -1.
+ Return a C :ctype:`long` representation of the contents of
+ *pylong*. If *pylong* is greater than :const:`LONG_MAX` or less
+ than :const:`LONG_MIN`, set `*overflow` to ``1`` or ``-1``,
+ respectively, and return ``-1``; otherwise, set `*overflow` to
+ ``0``. If any other exception occurs (for example a TypeError or
+ MemoryError), then ``-1`` will be returned and ``*overflow`` will
+ be ``0``.
.. cfunction:: Py_ssize_t PyLong_AsSsize_t(PyObject *pylong)