SF #1615701: make d.update(m) honor __getitem__() and keys() in dict subclasses

This commit is contained in:
Raymond Hettinger 2007-02-07 20:08:22 +00:00
parent 814ef237a2
commit 0922d71604
2 changed files with 9 additions and 1 deletions

View file

@ -1306,7 +1306,7 @@ PyDict_Merge(PyObject *a, PyObject *b, int override)
return -1;
}
mp = (dictobject*)a;
if (PyDict_Check(b)) {
if (PyDict_CheckExact(b)) {
other = (dictobject*)b;
if (other == mp || other->ma_used == 0)
/* a.update(a) or a.update({}); nothing to do */