Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

pyflakes helped fixes: cachefunc.py: resolve function redefinition

  • Loading branch information...
commit 2ce12c23b31b7a82341d85b4a848433d6d8c401c 1 parent 2900d1d
@zothar zothar authored
Showing with 6 additions and 6 deletions.
  1. +6 −6 cachefunc.py
View
12 cachefunc.py
@@ -142,23 +142,23 @@ def clear():
if __name__ == '__main__':
@lru_cache(maxsize=20)
- def f(x, y):
+ def f_lru(x, y):
return 3 * x + y
domain = range(5)
from random import choice
for i in range(1000):
- r = f(choice(domain), choice(domain))
+ r = f_lru(choice(domain), choice(domain))
- print(f.hits, f.misses)
+ print(f_lru.hits, f_lru.misses)
@lfu_cache(maxsize=20)
- def f(x, y):
+ def f_lfu(x, y):
return 3 * x + y
domain = range(5)
from random import choice
for i in range(1000):
- r = f(choice(domain), choice(domain))
+ r = f_lfu(choice(domain), choice(domain))
- print(f.hits, f.misses)
+ print(f_lfu.hits, f_lfu.misses)
Please sign in to comment.
Something went wrong with that request. Please try again.