Author terry.reedy
Recipients Mark.Shannon, inada.naoki, josh.r, louielu, r.david.murray, rhettinger, serhiy.storchaka, terry.reedy, tim.peters, vstinner, xiang.zhang
Date 2019-03-12.22:02:27
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
Some of my thoughts on this.

Conceptually, I expected that clearing a normal dict should make it an empty normal dict.  I presume that making it instead an empty shared key dict is a matter of efficiency and code simplicity.  If the 'anomaly' is to be corrected, changing .clear would be an alternative.

The fact that this patch 'rescues' people who use .setdefault when collections.defaultdict would be better does not especially persuade me (msg291817).  The dict method doc and docstring could refer to defaultdict for such situations.

In 3.8.0a2, empty sets, like empty dicts, are ready to add. Empty lists in a2 are *not*, so pre-allocation is not universal in CPython for mutable collections.
Date User Action Args
2019-03-12 22:02:27terry.reedysetrecipients: + terry.reedy, tim.peters, rhettinger, vstinner, r.david.murray, inada.naoki, Mark.Shannon, serhiy.storchaka, josh.r, xiang.zhang, louielu
2019-03-12 22:02:27terry.reedysetmessageid: <>
2019-03-12 22:02:27terry.reedylinkissue30040 messages
2019-03-12 22:02:27terry.reedycreate