-
-
Notifications
You must be signed in to change notification settings - Fork 192
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
Make the forced_update of @cached and @memoize accept the same parameters as the decorated function #115
Make the forced_update of @cached and @memoize accept the same parameters as the decorated function #115
Conversation
flask_caching/__init__.py
Outdated
"""Check if the function wants any arguments | ||
""" | ||
|
||
try: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now that Python 2 is removed, I guess we can simplify this now?
flask_caching/__init__.py
Outdated
@@ -390,7 +413,7 @@ def decorated_function(*args, **kwargs): | |||
args, kwargs, use_request=True | |||
) | |||
|
|||
if callable(forced_update) and forced_update() is True: | |||
if callable(forced_update) and (forced_update(*args, **kwargs) if wants_args(forced_update) else forced_update()) is True: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The line is a bit to long. I'd like to keep the line length to 80.
I am using black to keep my python files nicely formatted (we gotta add this to our not yet existing CONTRIBUTING file :P)
9b4a683
to
6ec5aa3
Compare
I think i fixed everything we talked about. Also, finally we have a coverage increase! 😄 |
6ec5aa3
to
eba5f72
Compare
Fixes #112