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 methane
Recipients methane, r.david.murray, serhiy.storchaka, xiang.zhang
Date 2017-04-12.00:06:47
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1491955608.2.0.598746051041.issue30040@psf.upfronthosting.co.za>
In-reply-to
Content
> I mean creating a solo empty dict doesn't seem to make much sense. Although it saves memory, but when it's populated, it's resized and the memory occupation comes back.

But sometimes it's not populated.

class A:
    def __init__(self, **kwargs):
        self._extra = kwargs

xa = [A() for _ in range(1000)]

So problem is (a) how many empty dicts, and (b) how much memory this patch saves.

> And this makes PyDict_New() hard to understand. :-(

Yes, but it is not new complexity because it's same to d.clear().
History
Date User Action Args
2017-04-12 00:06:48methanesetrecipients: + methane, r.david.murray, serhiy.storchaka, xiang.zhang
2017-04-12 00:06:48methanesetmessageid: <1491955608.2.0.598746051041.issue30040@psf.upfronthosting.co.za>
2017-04-12 00:06:48methanelinkissue30040 messages
2017-04-12 00:06:47methanecreate