]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Make it clear that PyNumber_AsSsize_t() returns -1 on error.
authorAntoine Pitrou <solipsis@pitrou.net>
Wed, 13 Jul 2011 19:02:22 +0000 (21:02 +0200)
committerAntoine Pitrou <solipsis@pitrou.net>
Wed, 13 Jul 2011 19:02:22 +0000 (21:02 +0200)
Doc/c-api/number.rst

index eda722d9e8465f8640956cf15e15619c33c37839..090fc649f172b2d18ac4021a1d0d3585cb67604e 100644 (file)
@@ -249,7 +249,9 @@ Number Protocol
 .. c:function:: Py_ssize_t PyNumber_AsSsize_t(PyObject *o, PyObject *exc)
 
    Returns *o* converted to a Py_ssize_t value if *o* can be interpreted as an
-   integer. If *o* can be converted to a Python int but the attempt to
+   integer.  If the call fails, an exception is raised and -1 is returned.
+
+   If *o* can be converted to a Python int but the attempt to
    convert to a Py_ssize_t value would raise an :exc:`OverflowError`, then the
    *exc* argument is the type of exception that will be raised (usually
    :exc:`IndexError` or :exc:`OverflowError`).  If *exc* is *NULL*, then the