@@ -1534,7 +1534,6 @@ This section describes other dictionary APIs that are simple to describe and hav
15341534
15351535.. index ::
15361536 single: Dictionary; PyDict_GetItemWithError()
1537- pair: Documentation Lacunae; PyDict_GetItemWithError()
15381537
15391538.. _chapter_containers_and_refcounts.dictionaries.pydict_getitemwitherror :
15401539
@@ -1550,34 +1549,12 @@ The C signature is:
15501549
15511550 PyObject *PyDict_GetItemWithError(PyObject *p, PyObject *key);
15521551
1553- .. warning ::
1554-
1555- This function is incorrectly documented as it fails to set an exception with a missing key as this code
1556- demonstrates:
1557-
1558- .. code-block :: c
1552+ Currently, the only failure mode is if the first argument is not a dictionary.
15591553
1560- assert(!PyErr_Occurred());
1561- PyObject *container = PyDict_New();
1562- assert(container && Py_REFCNT(container) == 1);
1563-
1564- PyObject *key = new_unique_string(__FUNCTION__, NULL);
1565-
1566- assert(!PyErr_Occurred());
1567- PyObject *get_item = PyDict_GetItemWithError(container, key);
1568- /* This is the failure point. An exception should have been set with
1569- * an absent key but it isn't. */
1570- assert(!PyErr_Occurred());
1571-
1572- assert(get_item == NULL);
1573-
1574- Py_DECREF(container);
1575- Py_DECREF(key);
1576-
1577- For code and tests see:
1554+ For code and tests see:
15781555
1579- * C, in ``src/cpy/Containers/DebugContainers.c ``:
1580- * ``dbg_PyDict_GetItemWithError_fails() ``
1556+ * C, in ``src/cpy/Containers/DebugContainers.c ``:
1557+ * ``dbg_PyDict_GetItemWithError_fails() ``
15811558
15821559.. index ::
15831560 single: Dictionary; PyDict_DelItem()
0 commit comments