Conditions | 1 |
Total Lines | 11 |
Code Lines | 4 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | """ |
||
27 | def cached(decorated: Callable): |
||
28 | """ |
||
29 | Alternative for ``functools.lru_cache``. By decorating a function with |
||
30 | ``cached``, you can clear the cache of that function by calling |
||
31 | ``clear()``. |
||
32 | :param decorated: the decorated function. |
||
33 | :return: a wrapped function. |
||
34 | """ |
||
35 | wrapper = _Wrapper(decorated) |
||
36 | update_wrapper(wrapper=wrapper, wrapped=decorated) |
||
37 | return wrapper |
||
38 | |||
47 |