summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2014-03-25 08:34:30 (GMT)
committerGeorg Brandl <georg@python.org>2014-03-25 08:34:30 (GMT)
commit1c669c1154d505a055f14b919f48e8fa1e1ab7cf (patch)
treec1181d6b1f809718a58c1ee3e07b86697f17207c
parent1f99f9d5c2ebe35838e275b3b4d4bb96ab212def (diff)
downloadcpython-1c669c1154d505a055f14b919f48e8fa1e1ab7cf.zip
cpython-1c669c1154d505a055f14b919f48e8fa1e1ab7cf.tar.gz
cpython-1c669c1154d505a055f14b919f48e8fa1e1ab7cf.tar.bz2
Closes #18456: Doc fix: PyDict_Update only works with dict-like objects, not key-value sequences. Patch by priyapappachan.
-rw-r--r--Doc/c-api/dict.rst7
1 files changed, 5 insertions, 2 deletions
diff --git a/Doc/c-api/dict.rst b/Doc/c-api/dict.rst
index 5a9dca2..aeff640 100644
--- a/Doc/c-api/dict.rst
+++ b/Doc/c-api/dict.rst
@@ -201,8 +201,11 @@ Dictionary Objects
.. c:function:: int PyDict_Update(PyObject *a, PyObject *b)
- This is the same as ``PyDict_Merge(a, b, 1)`` in C, or ``a.update(b)`` in
- Python. Return ``0`` on success or ``-1`` if an exception was raised.
+ 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.
.. c:function:: int PyDict_MergeFromSeq2(PyObject *a, PyObject *seq2, int override)