Message213949
namedtuple_source.patch: Replace _source attribute wasting memory with a property generating the source on demand. The patch adds also unit test for the verbose attribute (which is public and documented, even it is said to be "outdated").
The patch removes also repr_fmt and num_fields parameters of the class definition template, compute these values using the list of fields.
I suggested to change Python 3.4.1 and 3.5.
Test script:
---
import email
import http.client
import pickle
import test.regrtest
import test.test_os
import tracemalloc
import xmlrpc.server
snap = tracemalloc.take_snapshot()
with open("dump.pickle", "wb") as fp:
pickle.dump(snap, fp, 2)
---
With the patch, the memory footprint is reduced by 176 kB. |
|
Date |
User |
Action |
Args |
2014-03-18 08:57:54 | vstinner | set | recipients:
+ vstinner, rhettinger, eric.smith, christian.heimes, eric.araujo, eric.snow |
2014-03-18 08:57:54 | vstinner | set | messageid: <1395133074.03.0.595391366856.issue19640@psf.upfronthosting.co.za> |
2014-03-18 08:57:54 | vstinner | link | issue19640 messages |
2014-03-18 08:57:53 | vstinner | create | |
|