diff --git a/Doc/faq/programming.rst b/Doc/faq/programming.rst index 6514c00d1114e2..a3fb2fa5323cf6 100644 --- a/Doc/faq/programming.rst +++ b/Doc/faq/programming.rst @@ -1897,6 +1897,8 @@ The classes can be used like this: 'blog-why-python-rocks' +.. _faq-cache-method-calls: + How do I cache method calls? ---------------------------- diff --git a/Doc/library/functools.rst b/Doc/library/functools.rst index 00aca09bc7af45..d6792ed6fb77fb 100644 --- a/Doc/library/functools.rst +++ b/Doc/library/functools.rst @@ -191,6 +191,9 @@ The :mod:`functools` module defines the following functions: The cache keeps references to the arguments and return values until they age out of the cache or until the cache is cleared. + If a method is cached, the `self` instance argument is included in the + cache. See :ref:`faq-cache-method-calls` + An `LRU (least recently used) cache `_ works best when the most recent calls are the best predictors of upcoming