diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2018-12-18 11:57:17 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-12-18 11:57:17 (GMT) |
commit | 3fcc1e08db6fb7e17acc4a8f63be3e42f52f094b (patch) | |
tree | 4f142af24eb8ba7869649598ac36be5aa35e192d /Doc/c-api/mapping.rst | |
parent | 62a68b762a479a72c3defba9ace5f72a0063c5c6 (diff) | |
download | cpython-3fcc1e08db6fb7e17acc4a8f63be3e42f52f094b.zip cpython-3fcc1e08db6fb7e17acc4a8f63be3e42f52f094b.tar.gz cpython-3fcc1e08db6fb7e17acc4a8f63be3e42f52f094b.tar.bz2 |
bpo-35461: Document C API functions which suppress exceptions. (GH-11119)
Diffstat (limited to 'Doc/c-api/mapping.rst')
-rw-r--r-- | Doc/c-api/mapping.rst | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Doc/c-api/mapping.rst b/Doc/c-api/mapping.rst index b8eaadb..e37dec9 100644 --- a/Doc/c-api/mapping.rst +++ b/Doc/c-api/mapping.rst @@ -60,6 +60,10 @@ See also :c:func:`PyObject_GetItem`, :c:func:`PyObject_SetItem` and This is equivalent to the Python expression ``key in o``. This function always succeeds. + Note that exceptions which occur while calling the :meth:`__getitem__` + method will get suppressed. + To get error reporting use :c:func:`PyObject_GetItem()` instead. + .. c:function:: int PyMapping_HasKeyString(PyObject *o, const char *key) @@ -67,6 +71,10 @@ See also :c:func:`PyObject_GetItem`, :c:func:`PyObject_SetItem` and This is equivalent to the Python expression ``key in o``. This function always succeeds. + Note that exceptions which occur while calling the :meth:`__getitem__` + method and creating a temporary string object will get suppressed. + To get error reporting use :c:func:`PyMapping_GetItemString()` instead. + .. c:function:: PyObject* PyMapping_Keys(PyObject *o) |