https://github.com/python/cpython/commit/9629dfe19d484288c313e4e44bf643740eaaeb01 commit: 9629dfe19d484288c313e4e44bf643740eaaeb01 branch: 3.14 author: Miss Islington (bot) <[email protected]> committer: sobolevn <[email protected]> date: 2026-11-14T05:50:10Z summary:
[3.14] gh-160669: Clarify `PyDict_Update` docs (GH-161314) (#161984) gh-160669: Clarify `PyDict_Update` docs (GH-161314) (cherry picked from commit 797087c386dfaeaafe7fdd741194f10100f3ac13) Co-authored-by: sobolevn <[email protected]> Co-authored-by: Petr Viktorin <[email protected]> Co-authored-by: Victor Stinner <[email protected]> files: M Doc/c-api/dict.rst diff --git a/Doc/c-api/dict.rst b/Doc/c-api/dict.rst index 9ad2d7333a6cd4..f5d550f90b5340 100644 --- a/Doc/c-api/dict.rst +++ b/Doc/c-api/dict.rst @@ -405,11 +405,14 @@ Dictionary Objects .. c:function:: int PyDict_Update(PyObject *a, PyObject *b) - This is the same as ``PyDict_Merge(a, b, 1)`` in C, and is similar to - ``a.update(b)`` in Python except that :c:func:`PyDict_Update` doesn't fall - back to the iterating over a sequence of key value pairs if the second - argument has no "keys" attribute. Return ``0`` on success or ``-1`` if an - exception was raised. + This is the same as ``PyDict_Merge(a, b, 1)`` in C. + + Similar to ``a.update(b)`` in Python, except that this function + does not fall back to the iterating over a sequence of key-value pairs + if *b* is not a mapping. + Use :c:func:`PyDict_MergeFromSeq2` for this case. + + Return ``0`` on success or ``-1`` if an exception was raised. .. note:: _______________________________________________ Python-checkins mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail.python.org/mailman3//lists/python-checkins.python.org Member address: [email protected]
