Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 325eb47 commit fd06047Copy full SHA for fd06047
1 file changed
Doc/c-api/number.rst
@@ -249,7 +249,9 @@ Number Protocol
249
.. c:function:: Py_ssize_t PyNumber_AsSsize_t(PyObject *o, PyObject *exc)
250
251
Returns *o* converted to a Py_ssize_t value if *o* can be interpreted as an
252
- 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.
253
+
254
+ If *o* can be converted to a Python int but the attempt to
255
convert to a Py_ssize_t value would raise an :exc:`OverflowError`, then the
256
*exc* argument is the type of exception that will be raised (usually
257
:exc:`IndexError` or :exc:`OverflowError`). If *exc* is *NULL*, then the
0 commit comments