[Python-checkins] cpython (3.4): Closes #18456: Doc fix: PyDict_Update only works with dict-like objects, not

georg.brandl python-checkins at python.org
Tue Mar 25 09:35:13 CET 2014


http://hg.python.org/cpython/rev/8e1637e3a099
changeset: 89960:8e1637e3a099
branch: 3.4
parent: 89958:7f87c26f59ab
user: Georg Brandl <georg at python.org>
date: Tue Mar 25 09:34:30 2014 +0100
summary:
 Closes #18456: Doc fix: PyDict_Update only works with dict-like objects, not key-value sequences. Patch by priyapappachan.
files:
 Doc/c-api/dict.rst | 7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/Doc/c-api/dict.rst b/Doc/c-api/dict.rst
--- a/Doc/c-api/dict.rst
+++ b/Doc/c-api/dict.rst
@@ -201,8 +201,11 @@
 
 .. 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)
-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /