mirror of
https://github.com/python/cpython.git
synced 2025-08-03 00:23:06 +00:00
SF #1615701: make d.update(m) honor __getitem__() and keys() in dict subclasses
This commit is contained in:
parent
814ef237a2
commit
0922d71604
2 changed files with 9 additions and 1 deletions
|
@ -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 */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue