mirror of
https://github.com/python/cpython.git
synced 2025-10-17 20:28:43 +00:00
Revert SF #1615701 (rev 53655): dict.update() does *not* call __getitem__() or
keys() if subclassed. This is to remain consistent with 2.5. See discussion here: http://mail.python.org/pipermail/python-dev/2007-April/072565.html
This commit is contained in:
parent
8d61db5a00
commit
e6e383f498
3 changed files with 13 additions and 9 deletions
|
@ -1352,7 +1352,7 @@ PyDict_Merge(PyObject *a, PyObject *b, int override)
|
|||
return -1;
|
||||
}
|
||||
mp = (dictobject*)a;
|
||||
if (PyDict_CheckExact(b)) {
|
||||
if (PyDict_Check(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