[New-bugs-announce] [issue42216] Optimize dict.popitem() & insert use case.

Inada Naoki report at bugs.python.org
Fri Oct 30 20:36:15 EDT 2020


New submission from Inada Naoki <songofacandy at gmail.com>:

PyDict_DelItem stores DUMMY entry in the hash table. Without DUMMY, collision chain will be broken so proving will be not working.

But `dict.popitem()` returns the last item in the insertion order. The item must be the last item of collision chain too.
So `dict.popitem()` can use EMPTY entry instead of DUMMY, and reduce dict resizing.

----------
components: Interpreter Core
messages: 380022
nosy: methane
priority: normal
severity: normal
status: open
title: Optimize dict.popitem() & insert use case.
versions: Python 3.10

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue42216>
_______________________________________


More information about the New-bugs-announce mailing list