[Python-checkins] CVS: python/dist/src/Include dictobject.h,2.22,2.23
Tim Peters
tim_one@users.sourceforge.net
Tue, 11 Dec 2001 10:51:10 -0800
Update of /cvsroot/python/python/dist/src/Include
In directory usw-pr-cvs1:/tmp/cvs-serv2320/python/Include
Modified Files:
dictobject.h
Log Message:
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.
Index: dictobject.h
===================================================================
RCS file: /cvsroot/python/python/dist/src/Include/dictobject.h,v
retrieving revision 2.22
retrieving revision 2.23
diff -C2 -d -r2.22 -r2.23
*** dictobject.h 2001/08/10 20:28:28 2.22
--- dictobject.h 2001/12/11 18:51:08 2.23
***************
*** 98,104 ****
extern DL_IMPORT(int) PyDict_Size(PyObject *mp);
extern DL_IMPORT(PyObject *) PyDict_Copy(PyObject *mp);
extern DL_IMPORT(int) PyDict_Update(PyObject *mp, PyObject *other);
- extern DL_IMPORT(int) PyDict_Merge(PyObject *mp, PyObject *other, int override);
extern DL_IMPORT(PyObject *) PyDict_GetItemString(PyObject *dp, char *key);
--- 98,122 ----
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);
+ /* 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);