@@ -235,9 +235,9 @@ def _get_args_dict(func, args, kwargs):
235
235
class multi_cached :
236
236
"""
237
237
Only supports functions that return dict-like structures. This decorator caches each key/value
238
- of the dict-like object returned by the function. The keys of the returned data should match
239
- or be mappable to a sequence or iterable that is passed as an argument to the decorated
240
- callable. The name of that argument is passed to this decorator via the parameter
238
+ of the dict-like object returned by the function. The dict keys of the returned data should
239
+ match the set of keys that are passed to the decorated callable in an iterable object.
240
+ The name of that argument is passed to this decorator via the parameter
241
241
``keys_from_attr``. ``keys_from_attr`` can be the name of a positional or keyword argument.
242
242
243
243
If the argument specified by ``keys_from_attr`` is an empty list, the cache will be ignored
@@ -271,14 +271,13 @@ class multi_cached:
271
271
happens in the background. Enabled by default
272
272
273
273
:param keys_from_attr: name of the arg or kwarg in the decorated callable that contains
274
- an iterable that corresponds to the keys returned by the decorated callable.
274
+ an iterable that yields the keys returned by the decorated callable.
275
275
:param namespace: string to use as default prefix for the key used in all operations of
276
276
the backend. Default is None
277
- :param key_builder: Callable that enables mapping the ``keys_from_attr`` keys to the keys
278
- in the dict-like structure that is returned by the callable; executed before accessing
279
- the cache for storage/retrieval. Receives a key from the iterable corresponding to
280
- ``keys_from_attr``, the callable, and the positional and keyword arguments that were
281
- passed to the decorated callable. This behavior is necessarily different than both
277
+ :param key_builder: Callable that enables mapping the decorated function's keys to the keys
278
+ used by the cache. Receives a key from the iterable corresponding to
279
+ ``keys_from_attr``, the decorated callable, and the positional and keyword arguments
280
+ that were passed to the decorated callable. This behavior is necessarily different than
282
281
``BaseCache.build_key()`` and the call signature differs from ``cached.key_builder``.
283
282
:param ttl: int seconds to store the keys. Default is 0 which means no expiration.
284
283
:param cache: cache class to use when calling the ``multi_set``/``multi_get`` operations.
0 commit comments