Skip to content

Commit a9a7e2c

Browse files
committed
Move extended @ttl_cache docs to proper place.
1 parent 072b7e1 commit a9a7e2c

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

docs/index.rst

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,7 @@ often called with the same arguments:
350350
`cache stampede`_ issues under high load, depending on your
351351
actual use case. Providing a `condition` variable will mitigate
352352
these situations, but will inflict some performance penalty.
353-
353+
354354
If no separate `lock` parameter is provided, `condition` must also
355355
implement the `context manager`_ protocol, and will also be used to
356356
guard access to the cache.
@@ -731,8 +731,9 @@ all the decorators in this module are thread-safe by default.
731731

732732
Decorator to wrap a function with a memoizing callable that saves
733733
up to `maxsize` results based on a Least Recently Used (LRU)
734-
algorithm with a per-item time-to-live (TTL) value.
735-
734+
algorithm with a per-item time-to-live (TTL) value. By default,
735+
the time-to-live is set to 600 seconds and :func:`time.monotonic`
736+
is used to retrieve the current time.
736737

737738
.. _@lru_cache: https://docs.python.org/3/library/functools.html#functools.lru_cache
738739
.. _cache algorithm: https://en.wikipedia.org/wiki/Cache_algorithms

src/cachetools/func.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,6 @@ def ttl_cache(maxsize=128, ttl=600, timer=time.monotonic, typed=False):
9393
up to `maxsize` results based on a Least Recently Used (LRU)
9494
algorithm with a per-item time-to-live (TTL) value.
9595
96-
By default, the time-to-live is set to 600 seconds (10 minutes).
9796
"""
9897
if maxsize is None:
9998
return _cache(_UnboundTTLCache(ttl, timer), None, typed)

0 commit comments

Comments
 (0)