Closed dphi closed 2 months ago
Hi, there seems to be an issue when cachier is being used as a decorator for a method. - Or am I understanding cachier wrong?
# Python 3.12.3 import cachier # v3.0.0 @cachier.cachier() def test(): return True class Test: @cachier.cachier() def test(self): return True if __name__ == "__main__": assert Test().test() == True # Works assert test() == True # Works cachier.enable_caching() assert Test().test() == True # Works assert test() == True # Works cachier.disable_caching() assert test() == True # Works assert Test().test() == True # TypeError: Test.test() missing 1 required positional argument: 'self'
Thanks,
Philipp
The fix for this bug was released in v3.0.1.
v3.0.1
Hi, there seems to be an issue when cachier is being used as a decorator for a method. - Or am I understanding cachier wrong?
Thanks,
Philipp