Lines Matching defs:cache
13 'total_ordering', 'cache', 'cmp_to_key', 'lru_cache', 'reduce',
435 the key multiple times on a cache miss.
452 """Make a cache key from optionally typed positional and keyword arguments
457 If there is only a single argument and its data type is known to cache
480 """Least-recently-used cache decorator.
482 If *maxsize* is set to None, the LRU features are disabled and the cache
491 View the cache statistics named tuple (hits, misses, maxsize, currsize)
492 with f.cache_info(). Clear the cache and statistics with f.cache_clear().
526 # Constants shared by all lru cache instances:
527 sentinel = object() # unique object used to signal cache misses
531 cache = {}
534 cache_get = cache.get # bound method to lookup a key or return None
535 cache_len = cache.__len__ # get cache size without calling len()
561 cache[key] = result
586 if key in cache:
588 # cache while the lock was released. Since the link
607 # Now update the cache dictionary.
608 del cache[oldkey]
609 # Save the potentially reentrant cache[key] assignment
612 cache[key] = oldroot
617 last[NEXT] = root[PREV] = cache[key] = link
624 """Report cache statistics"""
629 """Clear the cache and cache statistics"""
632 cache.clear()
648 ### cache -- simplified access to the infinity cache
651 def cache(user_function, /):
652 'Simple lightweight unbounded cache. Sometimes called "memoize".'
988 cache = instance.__dict__
992 f"instance to cache {self.attrname!r} property."
995 val = cache.get(self.attrname, _NOT_FOUND)
998 # check if another thread filled cache while we awaited lock
999 val = cache.get(self.attrname, _NOT_FOUND)
1003 cache[self.attrname] = val