]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-112066: Add `PyDict_SetDefaultRef` function. (#112123)
authorSam Gross <colesbury@gmail.com>
Tue, 6 Feb 2024 16:36:23 +0000 (11:36 -0500)
committerGitHub <noreply@github.com>
Tue, 6 Feb 2024 16:36:23 +0000 (11:36 -0500)
commitde61d4bd4db868ce49a729a283763b94f2fda961
tree00f712e2df606a604cf86d1ce4d384db4d2f1478
parent0e2ab73dc31e0b8ea1827ec24bae93ae2644c617
gh-112066: Add `PyDict_SetDefaultRef` function. (#112123)

The `PyDict_SetDefaultRef` function is similar to `PyDict_SetDefault`,
but returns a strong reference through the optional `**result` pointer
instead of a borrowed reference.

Co-authored-by: Petr Viktorin <encukou@gmail.com>
Doc/c-api/dict.rst
Doc/whatsnew/3.13.rst
Include/cpython/dictobject.h
Lib/test/test_capi/test_dict.py
Misc/NEWS.d/next/C API/2023-11-15-13-47-48.gh-issue-112066.22WsqR.rst [new file with mode: 0644]
Modules/_testcapi/dict.c
Objects/dictobject.c