diff options
author | Benjamin Peterson <benjamin@python.org> | 2010-08-08 13:17:07 (GMT) |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2010-08-08 13:17:07 (GMT) |
commit | 1f594ad424311fc3fb558a9ddfb126c5c9a0287e (patch) | |
tree | a2d7da58c197744e4ee145770b0a9aeff62b6f13 /Lib | |
parent | c41e1fad496b8e3ec793d42ae9356109755ee005 (diff) | |
download | cpython-1f594ad424311fc3fb558a9ddfb126c5c9a0287e.zip cpython-1f594ad424311fc3fb558a9ddfb126c5c9a0287e.tar.gz cpython-1f594ad424311fc3fb558a9ddfb126c5c9a0287e.tar.bz2 |
use same quoting as the rest of the file
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/functools.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/Lib/functools.py b/Lib/functools.py index e244070..9d8cea9 100644 --- a/Lib/functools.py +++ b/Lib/functools.py @@ -107,14 +107,14 @@ def cmp_to_key(mycmp): return K def lfu_cache(maxsize=100): - '''Least-frequently-used cache decorator. + """Least-frequently-used cache decorator. Arguments to the cached function must be hashable. Cache performance statistics stored in f.hits and f.misses. Clear the cache using f.clear(). http://en.wikipedia.org/wiki/Cache_algorithms#Least-Frequently_Used - ''' + """ def decorating_function(user_function): cache = {} # mapping of args to results use_count = Counter() # times each key has been accessed @@ -142,7 +142,7 @@ def lfu_cache(maxsize=100): return result def clear(): - 'Clear the cache and cache statistics' + """Clear the cache and cache statistics""" cache.clear() use_count.clear() wrapper.hits = wrapper.misses = 0 @@ -153,14 +153,14 @@ def lfu_cache(maxsize=100): return decorating_function def lru_cache(maxsize=100): - '''Least-recently-used cache decorator. + """Least-recently-used cache decorator. Arguments to the cached function must be hashable. Cache performance statistics stored in f.hits and f.misses. Clear the cache using f.clear(). http://en.wikipedia.org/wiki/Cache_algorithms#Least_Recently_Used - ''' + """ def decorating_function(user_function): cache = OrderedDict() # ordered least recent to most recent kwd_mark = object() # separate positional and keyword args @@ -182,7 +182,7 @@ def lru_cache(maxsize=100): return result def clear(): - 'Clear the cache and cache statistics' + """Clear the cache and cache statistics""" cache.clear() wrapper.hits = wrapper.misses = 0 |