diff options
author | Antoine Pitrou <solipsis@pitrou.net> | 2011-07-13 19:02:58 (GMT) |
---|---|---|
committer | Antoine Pitrou <solipsis@pitrou.net> | 2011-07-13 19:02:58 (GMT) |
commit | 8442124693bf090b257b84b190aaa9a7024feffa (patch) | |
tree | 85da90e018648f19cf12fdb1301a7908a59c716e /Doc/c-api | |
parent | 993409ddc07d9b25fcb7a99b2689d38494f1da72 (diff) | |
parent | fd060474e3cc51528d321bbd52323036f9fda80d (diff) | |
download | cpython-8442124693bf090b257b84b190aaa9a7024feffa.zip cpython-8442124693bf090b257b84b190aaa9a7024feffa.tar.gz cpython-8442124693bf090b257b84b190aaa9a7024feffa.tar.bz2 |
Make it clear that PyNumber_AsSsize_t() returns -1 on error.
Diffstat (limited to 'Doc/c-api')
-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 eda722d..090fc64 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 |