[issue31179] Speed-up dict.copy() up to 5.5 times.

STINNER Victor report at bugs.python.org
Fri Aug 11 05:24:27 EDT 2017


STINNER Victor added the comment:

>>>> d = dict.fromkeys(range(2000))
>>>> for i in range(1999): del d[i]
> ...
>>>> sys.getsizeof(d)
> 41020
>>>> sys.getsizeof(d.copy())
> 136

Why "del" doesn't compact the dict?

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue31179>
_______________________________________


More information about the Python-bugs-list mailing list