Message291521
> 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(). |
|
Date |
User |
Action |
Args |
2017-04-12 00:06:48 | methane | set | recipients:
+ methane, r.david.murray, serhiy.storchaka, xiang.zhang |
2017-04-12 00:06:48 | methane | set | messageid: <1491955608.2.0.598746051041.issue30040@psf.upfronthosting.co.za> |
2017-04-12 00:06:48 | methane | link | issue30040 messages |
2017-04-12 00:06:47 | methane | create | |
|