-
-
Notifications
You must be signed in to change notification settings - Fork 195
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
key_prefix can support func ? : Expected type 'str', got '() -> str' instead #536
Comments
def cached(
self,
timeout: Optional[int] = None,
key_prefix: str = "view/%s", # line 240 <------- The str type is declared here, should it be removed?
unless: Optional[Callable] = None,
# ..........
if callable(key_prefix): # line 481 callable means there could be a function, so, Is it inappropriate to declare a str type?
cache_key = key_prefix() |
Hi @zystudios, You expose 2 problems in your issue :
David |
Thanks very much |
4 tasks
# for free
to join this conversation on GitHub.
Already have an account?
# to comment
when I use
@cache.cached(timeout=300, key_prefix=key_str())
The text was updated successfully, but these errors were encountered: