Browse Source
bpo-41802: Document 'PyDict_DelItem' can raise a 'KeyError' (GH-22291)
pull/22495/head
Campbell Barton
5 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
6 additions and
4 deletions
-
Doc/c-api/dict.rst
|
|
|
@ -81,14 +81,16 @@ Dictionary Objects |
|
|
|
.. c:function:: int PyDict_DelItem(PyObject *p, PyObject *key) |
|
|
|
|
|
|
|
Remove the entry in dictionary *p* with key *key*. *key* must be hashable; |
|
|
|
if it isn't, :exc:`TypeError` is raised. Return ``0`` on success or ``-1`` |
|
|
|
on failure. |
|
|
|
if it isn't, :exc:`TypeError` is raised. |
|
|
|
If *key* is not in the dictionary, :exc:`KeyError` is raised. |
|
|
|
Return ``0`` on success or ``-1`` on failure. |
|
|
|
|
|
|
|
|
|
|
|
.. c:function:: int PyDict_DelItemString(PyObject *p, const char *key) |
|
|
|
|
|
|
|
Remove the entry in dictionary *p* which has a key specified by the string |
|
|
|
*key*. Return ``0`` on success or ``-1`` on failure. |
|
|
|
Remove the entry in dictionary *p* which has a key specified by the string *key*. |
|
|
|
If *key* is not in the dictionary, :exc:`KeyError` is raised. |
|
|
|
Return ``0`` on success or ``-1`` on failure. |
|
|
|
|
|
|
|
|
|
|
|
.. c:function:: PyObject* PyDict_GetItem(PyObject *p, PyObject *key) |
|
|
|
|