How can the memoize cache be cleared?
The decorator works by injecting a dictionnary in the function
You can manually clear that dictionnary:
@memoize
def square (x):
return x*x
square(2)
square(3)
print square.__dict__
# {'cache': {(2,): 4, (3,): 9}}
square.cache.clear()
print square.__dict__
# {'cache': {}}
You can use module1.method1.cache.clear()
in your TearUp method