Serhiy Storchaka added the comment:

The side effect of this patch is making dict.copy() atomic. This is a worthy 
feature if extent it to dict constructor. For now the only way of making an 
atomic (or almost atomic) copy of a dict is dict(list(d.itemview())). It isn't 
very time and memory efficient.

If you will make dict copying removing holes and extend your patch to dict 
constructor, it could be more useful.

Look at the set implementation. It doesn't just use memcpy, but it contains 
specialized insertion implementation for the case if all items are unique. Fast 
copying is more important for dicts since the copying is more common for sets. 
It is a part of set operations and it is common to convert a set to a frozenset.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue31179>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to