-
-
Notifications
You must be signed in to change notification settings - Fork 194
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
key_prefix can support func ? : Expected type 'str', got '() -> str' instead #536
Comments
zystudios
changed the title
key_prefix can support func ? : Expected type 'str', got '() -> str' instead #208
key_prefix can support func ? : Expected type 'str', got '() -> str' instead
Sep 29, 2023
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
when I use
@cache.cached(timeout=300, key_prefix=key_str())
The text was updated successfully, but these errors were encountered: