Skip to content

Commit 06e1364

Browse files
authored
Update functools.rst
1 parent f74a61c commit 06e1364

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

Doc/library/functools.rst

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -151,14 +151,6 @@ The :mod:`functools` module defines the following functions:
151151
.. decorator:: lru_cache(user_function)
152152
lru_cache(maxsize=128, typed=False)
153153

154-
.. method:: cache_info()
155-
:no-typesetting:
156-
157-
158-
.. method:: cache_clear()
159-
:no-typesetting:
160-
161-
162154
Decorator to wrap a function with a memoizing callable that saves up to the
163155
*maxsize* most recent calls. It can save time when an expensive or I/O bound
164156
function is periodically called with the same arguments.
@@ -207,12 +199,18 @@ The :mod:`functools` module defines the following functions:
207199
and *typed*. This is for information purposes only. Mutating the values
208200
has no effect.
209201

202+
.. method:: functools.cache_info()
203+
:no-typesetting:
204+
210205
To help measure the effectiveness of the cache and tune the *maxsize*
211-
parameter, the wrapped function is instrumented with a :func:`cache_info`
206+
parameter, the wrapped function is instrumented with a :func:`!cache_info`
212207
function that returns a :term:`named tuple` showing *hits*, *misses*,
213208
*maxsize* and *currsize*.
214209

215-
The decorator also provides a :func:`cache_clear` function for clearing or
210+
.. method:: functools.cache_clear()
211+
:no-typesetting:
212+
213+
The decorator also provides a :func:`!cache_clear` function for clearing or
216214
invalidating the cache.
217215

218216
The original underlying function is accessible through the

0 commit comments

Comments
 (0)