Yury Selivanov added the comment:
>> PyDict_Copy creates a new empty dict object and then inserts key/values into
>> it one by one.
> Why not creating a "preallocated" dict in that case? _PyDict_NewPresized()
I don't think it's related to the proposed patch. Please take a look at the
PR. `_PyDict_NewPresized` and inserting entries one by one will not be faster
than a `memcpy`.
Python tracker <rep...@bugs.python.org>
Python-bugs-list mailing list