diff options
| author | Antoine Pitrou <solipsis@pitrou.net> | 2011-07-13 21:02:58 +0200 |
|---|---|---|
| committer | Antoine Pitrou <solipsis@pitrou.net> | 2011-07-13 21:02:58 +0200 |
| commit | cfddb3a61b89cedf63d3a5a5dce7dbe4ada5e6bd (patch) | |
| tree | 047e23a0904ba028966671478e04e4192d00da11 /Doc | |
| parent | 315e328b8e9b0c24ba2614f626a48068f447c9f9 (diff) | |
| parent | f03ab9c49de7fad48759bea70b8e2077691f6aa5 (diff) | |
| download | cpython-cfddb3a61b89cedf63d3a5a5dce7dbe4ada5e6bd.tar.gz | |
Make it clear that PyNumber_AsSsize_t() returns -1 on error.
Diffstat (limited to 'Doc')
| -rw-r--r-- | Doc/c-api/number.rst | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Doc/c-api/number.rst b/Doc/c-api/number.rst index eda722d9e8..090fc649f1 100644 --- a/Doc/c-api/number.rst +++ b/Doc/c-api/number.rst @@ -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 |
