Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Python: Checkins
cpython: Flatten the lru cache keyword args tuple for better memory utilization.
 

Index | Next | Previous | View Flat


python-checkins at python

Apr 29, 2012, 12:28 PM


Views: 57
Permalink
cpython: Flatten the lru cache keyword args tuple for better memory utilization.

http://hg.python.org/cpython/rev/399cb1afb747
changeset: 76643:399cb1afb747
user: Raymond Hettinger <python [at] rcn>
date: Sun Apr 29 12:28:02 2012 -0700
summary:
Flatten the lru cache keyword args tuple for better memory utilization.

files:
Lib/functools.py | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)


diff --git a/Lib/functools.py b/Lib/functools.py
--- a/Lib/functools.py
+++ b/Lib/functools.py
@@ -185,7 +185,9 @@
key = args
if kwds:
sorted_items = tuple(sorted(kwds.items()))
- key += kwd_mark + sorted_items
+ key += kwd_mark
+ key += tuple(k for k, v in sorted_items)
+ key += tuple(v for k, v in sorted_items)
if typed:
key += tuple(type(v) for v in args)
if kwds:

--
Repository URL: http://hg.python.org/cpython

Subject User Time
cpython: Flatten the lru cache keyword args tuple for better memory utilization. python-checkins at python Apr 29, 2012, 12:28 PM

  Index | Next | Previous | View Flat
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.