diff -r 98a57845c8cc Objects/dictobject.c --- a/Objects/dictobject.c Fri Sep 09 07:38:50 2016 +0000 +++ b/Objects/dictobject.c Fri Sep 09 20:02:22 2016 +0900 @@ -1546,6 +1546,16 @@ return -1; } assert(dk_get_index(mp->ma_keys, hashpos) == ix); + + // Split table doesn't allow deletion. Combine it. + if (_PyDict_HasSplitTable(mp)) { + if (dictresize(mp, DK_SIZE(mp->ma_keys))) { + return -1; + } + ix = (mp->ma_keys->dk_lookup)(mp, key, hash, &value_addr, &hashpos); + assert(ix >= 0); + } + old_value = *value_addr; *value_addr = NULL; mp->ma_used--; @@ -1725,7 +1735,17 @@ return NULL; } + // Split table doesn't allow deletion. Combine it. + if (_PyDict_HasSplitTable(mp)) { + if (dictresize(mp, DK_SIZE(mp->ma_keys))) { + return NULL; + } + ix = (mp->ma_keys->dk_lookup)(mp, key, hash, &value_addr, &hashpos); + assert(ix >= 0); + } + old_value = *value_addr; + assert(old_value != NULL); *value_addr = NULL; mp->ma_used--; mp->ma_version_tag = DICT_NEXT_VERSION();