-
This works: @classmethod
@cachebox.cachedmethod(Cache(0)) However I get an error in my editor:
Flipping the order of the decorators does not work. |
Beta Was this translation helpful? Give feedback.
Answered by
awolverp
Nov 27, 2024
Replies: 2 comments 5 replies
-
Use cached for staticmethod and cachedmethod for classmethod. @cachedmethod(...)
@classmethod
def test1(cls, params):
...
@cached(...)
@staticmethod
def test2(params):
... Editor might show an error (if type checking is enabled) or might not correctly infer the return value (in this case, just specify what the function will return), but the code works. I'll fix this issue soon. |
Beta Was this translation helpful? Give feedback.
4 replies
Answer selected by
rdong8
-
Also, how do we handle default arguments in key_maker? |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Use cached for staticmethod and cachedmethod for classmethod.
Editor might show an error (if type checking is enabled) or might not correctly infer the return value (in this case, just specify what the function will return), but the code works. I'll fix this issue soon.