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 anacrolix
Recipients anacrolix, giampaolo.rodola, meador.inge, nedbat, rhettinger
Date 2012-03-26.10:53:31
SpamBayes Score 0.00028058313
Marked as misclassified No
Message-id <1332759214.37.0.638978173116.issue14373@psf.upfronthosting.co.za>
In-reply-to
Content
I've fixed the commenting, and cache_info use.

I've left the element management in pure C as it reduces memory use (56 bytes for 4 element list, vs. 16 for lru_cache_elem), and avoids ref counting overhead (3 refs per link, plus GC). The difference might become quite marked for very large caches. There's also a nice invariant that links the key to the cache dict, and the result object to the lru_cache_elem. I'm happy to change this if it doesn't matter.

My only concern now is the wrapping of the lru cache object. In the Python version, @wraps allows the lru_cache to masquerade as the wrapped function wrt str/repr. The C version is wrapped, but str/repr remain unchanged. Not sure if this is a problem.
History
Date User Action Args
2012-03-26 10:53:34anacrolixsetrecipients: + anacrolix, rhettinger, giampaolo.rodola, nedbat, meador.inge
2012-03-26 10:53:34anacrolixsetmessageid: <1332759214.37.0.638978173116.issue14373@psf.upfronthosting.co.za>
2012-03-26 10:53:33anacrolixlinkissue14373 messages
2012-03-26 10:53:33anacrolixcreate