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.rst23
1 files changed, 17 insertions, 6 deletions
diff --git a/Doc/c-api/long.rst b/Doc/c-api/long.rst
index 4b21fd4..5caa89e 100644
--- a/Doc/c-api/long.rst
+++ b/Doc/c-api/long.rst
@@ -155,21 +155,32 @@ Long Integer Objects
.. cfunction:: PY_LONG_LONG PyLong_AsLongLong(PyObject *pylong)
- Return a C :ctype:`long long` from a Python long integer. If *pylong* cannot be
- represented as a :ctype:`long long`, an :exc:`OverflowError` will be raised.
+ .. index::
+ single: OverflowError (built-in exception)
+
+ Return a C :ctype:`long long` from a Python long integer. If
+ *pylong* cannot be represented as a :ctype:`long long`, an
+ :exc:`OverflowError` is raised and ``-1`` is returned.
.. versionadded:: 2.2
.. cfunction:: unsigned PY_LONG_LONG PyLong_AsUnsignedLongLong(PyObject *pylong)
- Return a C :ctype:`unsigned long long` from a Python long integer. If *pylong*
- cannot be represented as an :ctype:`unsigned long long`, an :exc:`OverflowError`
- will be raised if the value is positive, or a :exc:`TypeError` will be raised if
- the value is negative.
+ .. index::
+ single: OverflowError (built-in exception)
+
+ Return a C :ctype:`unsigned long long` from a Python long integer. If
+ *pylong* cannot be represented as an :ctype:`unsigned long long`, an
+ :exc:`OverflowError` is raised and ``(unsigned long long)-1`` is
+ returned.
.. versionadded:: 2.2
+ .. versionchanged:: 2.7
+ A negative *pylong* now raises :exc:`OverflowError`, not
+ :exc:`TypeError`.
+
.. cfunction:: unsigned long PyLong_AsUnsignedLongMask(PyObject *io)