[Python-checkins] cpython (merge 3.2 -> default): Make it clear that PyNumber_AsSsize_t() returns -1 on error.

antoine.pitrou python-checkins at python.org
Wed Jul 13 21:04:08 CEST 2011


http://hg.python.org/cpython/rev/0a5352cb19df
changeset:   71308:0a5352cb19df
parent:      71305:8893fc8e885e
parent:      71307:4105b0653bc3
user:        Antoine Pitrou <solipsis at pitrou.net>
date:        Wed Jul 13 21:02:58 2011 +0200
summary:
  Make it clear that PyNumber_AsSsize_t() returns -1 on error.

files:
  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
--- a/Doc/c-api/number.rst
+++ b/Doc/c-api/number.rst
@@ -249,7 +249,9 @@
 .. 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

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list