This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author serhiy.storchaka
Recipients methane, rhettinger, serhiy.storchaka, vstinner, yselivanov
Date 2017-08-17.13:55:20
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1502978120.39.0.661856583449.issue31179@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2017-08-17 13:55:20serhiy.storchakasetrecipients: + serhiy.storchaka, rhettinger, vstinner, methane, yselivanov
2017-08-17 13:55:20serhiy.storchakasetmessageid: <1502978120.39.0.661856583449.issue31179@psf.upfronthosting.co.za>
2017-08-17 13:55:20serhiy.storchakalinkissue31179 messages
2017-08-17 13:55:20serhiy.storchakacreate