diff options
author | Mark Dickinson <dickinsm@gmail.com> | 2010-01-30 10:08:33 (GMT) |
---|---|---|
committer | Mark Dickinson <dickinsm@gmail.com> | 2010-01-30 10:08:33 (GMT) |
commit | a36507c64cd8d299749c758503b0951070e202f8 (patch) | |
tree | 0b90f9b4ef76013d53300ba7de85a715a3aa958e /Doc | |
parent | a2d465374099c582ef9bc042c2fe1be4776ee641 (diff) | |
download | cpython-a36507c64cd8d299749c758503b0951070e202f8.zip cpython-a36507c64cd8d299749c758503b0951070e202f8.tar.gz cpython-a36507c64cd8d299749c758503b0951070e202f8.tar.bz2 |
Issue #7767: Add new C-API function PyLong_AsLongLongAndOverflow, a
long long variant of PyLong_AsLongAndOverflow. Patch by Case Van
Horsen.
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/c-api/long.rst | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/Doc/c-api/long.rst b/Doc/c-api/long.rst index 7453ccd..b8fced5 100644 --- a/Doc/c-api/long.rst +++ b/Doc/c-api/long.rst @@ -146,6 +146,19 @@ Long Integer Objects .. versionadded:: 2.7 +.. cfunction:: PY_LONG_LONG PyLong_AsLongLongAndOverflow(PyObject *pylong, int* overflow) + + Return a C :ctype:`long long` representation of the contents of + *pylong*. If *pylong* is greater than :const:`PY_LLONG_MAX` or less + than :const:`PY_LLONG_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``. + + .. versionadded:: 2.7 + + .. cfunction:: Py_ssize_t PyLong_AsSsize_t(PyObject *pylong) .. index:: |