##// END OF EJS Templates
add comments in cachefunc
Benoit Boissinot -
r3147:97420a49 default
parent child Browse files
Show More
@@ -26,8 +26,11 b' class SignalInterrupt(Exception):'
26 26
27 27 def cachefunc(func):
28 28 '''cache the result of function calls'''
29 # XXX doesn't handle keywords args
29 30 cache = {}
30 31 if func.func_code.co_argcount == 1:
32 # we gain a small amount of time because
33 # we don't need to pack/unpack the list
31 34 def f(arg):
32 35 if arg not in cache:
33 36 cache[arg] = func(arg)
General Comments 0
You need to be logged in to leave comments. Login now