Show More
@@ -450,7 +450,7 b' extendeddateformats = defaultdateformats' | |||
|
450 | 450 | def cachefunc(func): |
|
451 | 451 | '''cache the result of function calls''' |
|
452 | 452 | # XXX doesn't handle keywords args |
|
453 |
if func. |
|
|
453 | if func.__code__.co_argcount == 0: | |
|
454 | 454 | cache = [] |
|
455 | 455 | def f(): |
|
456 | 456 | if len(cache) == 0: |
@@ -458,7 +458,7 b' def cachefunc(func):' | |||
|
458 | 458 | return cache[0] |
|
459 | 459 | return f |
|
460 | 460 | cache = {} |
|
461 |
if func. |
|
|
461 | if func.__code__.co_argcount == 1: | |
|
462 | 462 | # we gain a small amount of time because |
|
463 | 463 | # we don't need to pack/unpack the list |
|
464 | 464 | def f(arg): |
@@ -700,7 +700,7 b' def lrucachefunc(func):' | |||
|
700 | 700 | '''cache most recent results of function calls''' |
|
701 | 701 | cache = {} |
|
702 | 702 | order = collections.deque() |
|
703 |
if func. |
|
|
703 | if func.__code__.co_argcount == 1: | |
|
704 | 704 | def f(arg): |
|
705 | 705 | if arg not in cache: |
|
706 | 706 | if len(cache) > 20: |
General Comments 0
You need to be logged in to leave comments.
Login now