Skip to content

Commit 2750212

Browse files
committed
Update docs
1 parent 6811356 commit 2750212

3 files changed

Lines changed: 38 additions & 13 deletions

File tree

cachebox/utils.py

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -591,23 +591,23 @@ def cached(
591591
592592
Args:
593593
cache: Cache instance, ``dict``, or callable ``(self) -> cache`` for
594-
per-instance caches. ``None`` defaults to an unbounded
595-
:class:`LRUCache`.
594+
per-instance caches. ``None`` defaults to an unbounded
595+
:class:`LRUCache`.
596596
key_maker: Converts ``(args, kwds)`` to a hashable key. Built-ins:
597-
:func:`make_key` (default), :func:`make_hash_key`,
598-
:func:`make_typed_key`.
597+
:func:`make_key` (default), :func:`make_hash_key`,
598+
:func:`make_typed_key`.
599599
clear_reuse: Pass ``reuse=True`` to ``cache.clear()`` when
600-
:func:`cache_clear` is called.
600+
:func:`cache_clear` is called.
601601
callback: Called as ``callback(event, key, value)`` on every hit/miss.
602-
May be a coroutine in async contexts.
602+
May be a coroutine in async contexts.
603603
postprocess: Optional ``(value) -> value`` transform applied before
604-
returning a result to the caller. Ready-to-use options:
604+
returning a result to the caller. Ready-to-use options:
605605
606-
* ``None`` - return the cached object as-is.
607-
* :func:`postprocess_copy` - shallow-copy.
608-
* :func:`postprocess_copy_mutables` - shallow-copy only `dict`, `list` and `set` (default).
609-
* :func:`postprocess_deepcopy` - deep-copy.
610-
* :func:`postprocess_deepcopy_mutables` - deep-copy only `dict`, `list` and `set`.
606+
* ``None`` - return the cached object as-is.
607+
* :func:`postprocess_copy` - shallow-copy.
608+
* :func:`postprocess_copy_mutables` - shallow-copy only `dict`, `list` and `set` (default).
609+
* :func:`postprocess_deepcopy` - deep-copy.
610+
* :func:`postprocess_deepcopy_mutables` - deep-copy only `dict`, `list` and `set`.
611611
612612
Note:
613613
Pass ``cachebox__ignore=True`` at call-time to bypass the cache.
@@ -703,7 +703,7 @@ def get_cached_callback(cached_func: object) -> _Callback | None:
703703
return cached_func.callback # type: ignore
704704

705705

706-
def clear_cached_cache(cached_func: object) -> BaseCacheImpl:
706+
def clear_cached_cache(cached_func: object) -> None:
707707
"""
708708
A way to call ``cached_func.cache_clear()``, without type-hint warnings.
709709

docs/docs/api/index.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
You can see
2+
3+
- Core API reference [here](./impls.md)
4+
- Utilities API reference [here](./utils.md)

docs/docs/api/utils.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,22 @@
11

2+
::: cachebox.utils.postprocess_copy_mutables
3+
::: cachebox.utils.postprocess_copy
4+
::: cachebox.utils.postprocess_deepcopy_mutables
5+
::: cachebox.utils.postprocess_deepcopy
6+
7+
::: cachebox.utils.make_key
8+
::: cachebox.utils.make_hash_key
9+
::: cachebox.utils.make_typed_key
10+
11+
::: cachebox.utils.Frozen
12+
13+
::: cachebox.utils.CacheInfo
14+
::: cachebox.utils.EVENT_MISS
15+
::: cachebox.utils.EVENT_HIT
16+
17+
::: cachebox.utils.cached
18+
::: cachebox.utils.is_cached
19+
::: cachebox.utils.get_cached_cache
20+
::: cachebox.utils.get_cached_cache_info
21+
::: cachebox.utils.get_cached_callback
22+
::: cachebox.utils.clear_cached_cache

0 commit comments

Comments
 (0)