INADA Naoki added the comment:

> 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().

----------

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

Reply via email to