git-svn-id: https://linkchecker.svn.sourceforge.net/svnroot/linkchecker/trunk/linkchecker@3060 e7d03fd6-7b0d-0410-9947-9c21f3af8025
This commit is contained in:
calvin 2006-02-04 09:15:11 +00:00
parent bd8bfa06a3
commit 287ec3b960

View file

@ -152,12 +152,11 @@ def timeit (func, log=sys.stderr):
class memoized (object):
"""
Decorator that caches a function's return value each time it is called.
If called later with the same arguments, the cached value is returned, and
not re-evaluated.
"""
"""
Decorator that caches a function's return value each time it is called.
If called later with the same arguments, the cached value is returned, and
not re-evaluated.
"""
def __init__(self, func):
self.func = func
self.cache = {}
@ -179,12 +178,11 @@ class memoized (object):
class curried (object):
"""
Decorator that returns a function that keeps returning functions
until all arguments are supplied; then the original function is
evaluated.
"""
"""
Decorator that returns a function that keeps returning functions
until all arguments are supplied; then the original function is
evaluated.
"""
def __init__(self, func, *a):
self.func = func
self.args = a