diff options
author | Tim Peters <tim.peters@gmail.com> | 2001-12-11 18:51:08 (GMT) |
---|---|---|
committer | Tim Peters <tim.peters@gmail.com> | 2001-12-11 18:51:08 (GMT) |
commit | f582b82fe9ae4c0394ed4f6b281aa8b4ca224617 (patch) | |
tree | 77ade5444df813eb0ff1ccca21bd49611e3f512d /Include/dictobject.h | |
parent | c82bd7281fb52a66c59f567b7da18390ed9957c1 (diff) | |
download | cpython-f582b82fe9ae4c0394ed4f6b281aa8b4ca224617.zip cpython-f582b82fe9ae4c0394ed4f6b281aa8b4ca224617.tar.gz cpython-f582b82fe9ae4c0394ed4f6b281aa8b4ca224617.tar.bz2 |
SF bug #491415 PyDict_UpdateFromSeq2() unused
PyDict_UpdateFromSeq2(): removed it.
PyDict_MergeFromSeq2(): made it public and documented it.
PyDict_Merge() docs: updated to reveal <wink> that the second
argument can be any mapping object.
Diffstat (limited to 'Include/dictobject.h')
-rw-r--r-- | Include/dictobject.h | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/Include/dictobject.h b/Include/dictobject.h index 1132021..547430e 100644 --- a/Include/dictobject.h +++ b/Include/dictobject.h @@ -97,9 +97,27 @@ extern DL_IMPORT(PyObject *) PyDict_Values(PyObject *mp); extern DL_IMPORT(PyObject *) PyDict_Items(PyObject *mp); extern DL_IMPORT(int) PyDict_Size(PyObject *mp); extern DL_IMPORT(PyObject *) PyDict_Copy(PyObject *mp); + +/* PyDict_Update(mp, other) is equivalent to PyDict_Merge(mp, other, 1). */ extern DL_IMPORT(int) PyDict_Update(PyObject *mp, PyObject *other); -extern DL_IMPORT(int) PyDict_Merge(PyObject *mp, PyObject *other, int override); +/* PyDict_Merge updates/merges from a mapping object (an object that + supports PyMapping_Keys() and PyObject_GetItem()). If override is true, + the last occurrence of a key wins, else the first. The Python + dict.update(other) is equivalent to PyDict_Merge(dict, other, 1). +*/ +extern DL_IMPORT(int) PyDict_Merge(PyObject *mp, + PyObject *other, + int override); + +/* PyDict_MergeFromSeq2 updates/merges from an iterable object producing + iterable objects of length 2. If override is true, the last occurrence + of a key wins, else the first. The Python dict constructor dict(seq2) + is equivalent to dict={}; PyDict_MergeFromSeq(dict, seq2, 1). +*/ +extern DL_IMPORT(int) PyDict_MergeFromSeq2(PyObject *d, + PyObject *seq2, + int override); extern DL_IMPORT(PyObject *) PyDict_GetItemString(PyObject *dp, char *key); extern DL_IMPORT(int) PyDict_SetItemString(PyObject *dp, char *key, PyObject *item); |