summaryrefslogtreecommitdiffstats
path: root/Doc/c-api/dict.rst
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2018-12-18 11:57:17 (GMT)
committerGitHub <noreply@github.com>2018-12-18 11:57:17 (GMT)
commit3fcc1e08db6fb7e17acc4a8f63be3e42f52f094b (patch)
tree4f142af24eb8ba7869649598ac36be5aa35e192d /Doc/c-api/dict.rst
parent62a68b762a479a72c3defba9ace5f72a0063c5c6 (diff)
downloadcpython-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/dict.rst')
-rw-r--r--Doc/c-api/dict.rst9
1 files changed, 9 insertions, 0 deletions
diff --git a/Doc/c-api/dict.rst b/Doc/c-api/dict.rst
index b7225fa..4e55c1a 100644
--- a/Doc/c-api/dict.rst
+++ b/Doc/c-api/dict.rst
@@ -95,6 +95,10 @@ Dictionary Objects
Return the object from dictionary *p* which has a key *key*. Return *NULL*
if the key *key* is not present, but *without* setting an exception.
+ Note that exceptions which occur while calling :meth:`__hash__` and
+ :meth:`__eq__` methods will get suppressed.
+ To get error reporting use :c:func:`PyDict_GetItemWithError()` instead.
+
.. c:function:: PyObject* PyDict_GetItemWithError(PyObject *p, PyObject *key)
@@ -109,6 +113,11 @@ Dictionary Objects
This is the same as :c:func:`PyDict_GetItem`, but *key* is specified as a
:c:type:`const char\*`, rather than a :c:type:`PyObject\*`.
+ Note that exceptions which occur while calling :meth:`__hash__` and
+ :meth:`__eq__` methods and creating a temporary string object
+ will get suppressed.
+ To get error reporting use :c:func:`PyDict_GetItemWithError()` instead.
+
.. c:function:: PyObject* PyDict_SetDefault(PyObject *p, PyObject *key, PyObject *default)