@@ -372,9 +372,9 @@ a one second timeout. Operations will attempt to abort if they take longer than
372
372
one second. The remaining API of :class: `FanoutCache <diskcache.FanoutCache> `
373
373
matches :class: `Cache <diskcache.Cache> ` as described above.
374
374
375
- :class: ` FanoutCache <diskcache.FanoutCache> ` adds an additional feature:
376
- :meth: ` memoizing <diskcache.FanoutCache.memoize> ` cache decorator. The
377
- decorator wraps a callable and caches arguments and return values.
375
+ Caches have an additional feature: :meth: ` memoizing
376
+ <diskcache.FanoutCache.memoize> ` decorator. The decorator wraps a callable and
377
+ caches arguments and return values.
378
378
379
379
>>> from diskcache import FanoutCache
380
380
>>> cache = FanoutCache()
@@ -386,14 +386,14 @@ decorator wraps a callable and caches arguments and return values.
386
386
... return 1
387
387
... else :
388
388
... return fibonacci(number - 1 ) + fibonacci(number - 2 )
389
- >>> print (sum (fibonacci(number = value) for value in range (100 )))
389
+ >>> print (sum (fibonacci(value) for value in range (100 )))
390
390
573147844013817084100
391
391
392
392
The arguments to memoize are like those for `functools.lru_cache
393
393
<https://docs.python.org/3/library/functools.html#functools.lru_cache> `_ and
394
- :meth: `FanoutCache .set <diskcache.FanoutCache .set> `. Remember to call
395
- :meth: ` memoize <diskcache .FanoutCache.memoize> ` when decorating a callable. If
396
- you forget, then a TypeError will occur.
394
+ :meth: `Cache .set <.Cache .set> `. Remember to call :meth: ` memoize
395
+ < .FanoutCache.memoize> ` when decorating a callable. If you forget, then a
396
+ TypeError will occur::
397
397
398
398
>>> @cache.memoize
399
399
... def test():
@@ -403,7 +403,7 @@ you forget, then a TypeError will occur.
403
403
TypeError: name cannot be callable
404
404
405
405
Observe the lack of parenthenses after :meth: `memoize
406
- <diskcache.FanoutCache.set > ` above.
406
+ <diskcache.FanoutCache.memoize > ` above.
407
407
408
408
.. _`Sharding` : https://en.wikipedia.org/wiki/Shard_(database_architecture)
409
409
0 commit comments