We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
@cached_many
Suggested use case:
@cached_many(cache) def expensive_function(items: Iterable[K], …) -> Mapping[K, V]: … expensive_function(["foo", "bar", "qux"], …)
expensive_function should get called only on items which aren't present in the cache. Pseudo-code:
expensive_function
cached_items = cache.get_many(*items) new_items = wrapped_function(*(item for item in items if item not in cached_items), *args, **kwargs) cache.set_many(new_items) return {**cached_items, **new_items}
items
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Suggested use case:
Expected behaviour
expensive_function
should get called only on items which aren't present in the cache. Pseudo-code:Discussion
@cached_many
allow specifying of theitems
parameter by index or keyword argument name?The text was updated successfully, but these errors were encountered: