diff options
author | Georg Brandl <georg@python.org> | 2010-10-17 06:32:59 (GMT) |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2010-10-17 06:32:59 (GMT) |
commit | dd909db1a936fbccb5ff621f983423d801726af6 (patch) | |
tree | 453a3b791ab9492f02fd915875d1dcc2c86aa77c /Doc/c-api | |
parent | 17ef0d51d74be30306ceadfdb7f033e82a891670 (diff) | |
download | cpython-dd909db1a936fbccb5ff621f983423d801726af6.zip cpython-dd909db1a936fbccb5ff621f983423d801726af6.tar.gz cpython-dd909db1a936fbccb5ff621f983423d801726af6.tar.bz2 |
#10058: tweak wording about exception returns.
Diffstat (limited to 'Doc/c-api')
-rw-r--r-- | Doc/c-api/intro.rst | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/Doc/c-api/intro.rst b/Doc/c-api/intro.rst index e2a2f9a..6fecc61 100644 --- a/Doc/c-api/intro.rst +++ b/Doc/c-api/intro.rst @@ -361,15 +361,16 @@ traceback. .. index:: single: PyErr_Occurred() -For C programmers, however, error checking always has to be explicit. All -functions in the Python/C API can raise exceptions, unless an explicit claim is -made otherwise in a function's documentation. In general, when a function -encounters an error, it sets an exception, discards any object references that -it owns, and returns an error indicator --- usually *NULL* or ``-1``. A few -functions return a Boolean true/false result, with false indicating an error. -Very few functions return no explicit error indicator or have an ambiguous -return value, and require explicit testing for errors with -:c:func:`PyErr_Occurred`. +For C programmers, however, error checking always has to be explicit. All +functions in the Python/C API can raise exceptions, unless an explicit claim is +made otherwise in a function's documentation. In general, when a function +encounters an error, it sets an exception, discards any object references that +it owns, and returns an error indicator. If not documented otherwise, this +indicator is either *NULL* or ``-1``, depending on the function's return type. +A few functions return a Boolean true/false result, with false indicating an +error. Very few functions return no explicit error indicator or have an +ambiguous return value, and require explicit testing for errors with +:c:func:`PyErr_Occurred`. These exceptions are always explicitly documented. .. index:: single: PyErr_SetString() |