diff options
author | Victor Stinner <vstinner@python.org> | 2023-11-14 12:51:00 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-11-14 12:51:00 (GMT) |
commit | 4f04172c9287c507f1426e02ddfc432f1f3ade54 (patch) | |
tree | 800ac400c3776336e1f52b49a0f10b4dae9af8c1 /Doc/whatsnew/3.13.rst | |
parent | f44d6ff6e0c9eeb0bb246a3dd8f99d40b7050054 (diff) | |
download | cpython-4f04172c9287c507f1426e02ddfc432f1f3ade54.zip cpython-4f04172c9287c507f1426e02ddfc432f1f3ade54.tar.gz cpython-4f04172c9287c507f1426e02ddfc432f1f3ade54.tar.bz2 |
gh-111262: Add PyDict_Pop() function (#112028)
_PyDict_Pop_KnownHash(): remove the default value and the return type
becomes an int.
Co-authored-by: Stefan Behnel <stefan_ml@behnel.de>
Co-authored-by: Antoine Pitrou <pitrou@free.fr>
Diffstat (limited to 'Doc/whatsnew/3.13.rst')
-rw-r--r-- | Doc/whatsnew/3.13.rst | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Doc/whatsnew/3.13.rst b/Doc/whatsnew/3.13.rst index 81e133b..136fe90 100644 --- a/Doc/whatsnew/3.13.rst +++ b/Doc/whatsnew/3.13.rst @@ -1175,6 +1175,12 @@ New Features Python ``list.extend()`` and ``list.clear()`` methods. (Contributed by Victor Stinner in :gh:`111138`.) +* Add :c:func:`PyDict_Pop` and :c:func:`PyDict_PopString` functions: remove a + key from a dictionary and optionally return the removed value. This is + similar to :meth:`dict.pop`, but without the default value and not raising + :exc:`KeyError` if the key missing. + (Contributed by Stefan Behnel and Victor Stinner in :gh:`111262`.) + Porting to Python 3.13 ---------------------- |