Skip to content
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

Does invalidate() return the new cached result? #4

Closed
mbi opened this issue Oct 28, 2017 · 2 comments
Closed

Does invalidate() return the new cached result? #4

mbi opened this issue Oct 28, 2017 · 2 comments

Comments

@mbi
Copy link

mbi commented Oct 28, 2017

Your README seems to imply that the invalidate() call doesn't return the new value:

>>> expensive_function(100, 200)
121
>>> exensive_function.invalidate(1, 200)
>>> expensive_function(1, 100)
89

… however a call with _refresh=True does:

>>> expensive_function(100, 200)
121
>>> expensive_function(100, 200, _refresh=True)
177
>>> expensive_function(100, 200)
177

Is this correct?

@peterbe
Copy link
Owner

peterbe commented Nov 2, 2017

Correct understanding. The invalidate function doesn't actually run the function you're decoratoring.

Clearly this wasn't clear from the documentation (hence you filing this issue).
Can you suggest a docs update to make it more clear?

@mbi
Copy link
Author

mbi commented Nov 4, 2017

Nah, it's fine: I think it's clear enough as it is in the current README.

@mbi mbi closed this as completed Nov 4, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants