Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent db60bb5 commit 1fb6088Copy full SHA for 1fb6088
1 file changed
Objects/dictobject.c
@@ -809,8 +809,8 @@ dict_update(register dictobject *mp, PyObject *args)
809
dictentry *entry;
810
if (!PyArg_Parse(args, "O!", &PyDict_Type, &other))
811
return NULL;
812
- if (other == mp)
813
- goto done; /* a.update(a); nothing to do */
+ if (other == mp || other->ma_used == 0)
+ goto done; /* a.update(a) or a.update({}); nothing to do */
814
/* Do one big resize at the start, rather than incrementally
815
resizing as we insert new items. Expect that there will be
816
no (or few) overlapping keys. */
0 commit comments