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 vstinner
Recipients christian.heimes, eric.araujo, eric.smith, eric.snow, rhettinger, vstinner
Date 2014-03-18.08:57:51
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1395133074.03.0.595391366856.issue19640@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2014-03-18 08:57:54vstinnersetrecipients: + vstinner, rhettinger, eric.smith, christian.heimes, eric.araujo, eric.snow
2014-03-18 08:57:54vstinnersetmessageid: <1395133074.03.0.595391366856.issue19640@psf.upfronthosting.co.za>
2014-03-18 08:57:54vstinnerlinkissue19640 messages
2014-03-18 08:57:53vstinnercreate