MCPcopy Create free account
hub / github.com/TheAlgorithms/Python / __repr__

Method __repr__

other/lru_cache.py:220–229  ·  view source on GitHub ↗

Return the details for the cache instance [hits, misses, capacity, current_size]

(self)

Source from the content-addressed store, hash-verified

218 self.cache: dict[T, DoubleLinkedListNode[T, U]] = {}
219
220 def __repr__(self) -> str:
221 """
222 Return the details for the cache instance
223 [hits, misses, capacity, current_size]
224 """
225
226 return (
227 f"CacheInfo(hits={self.hits}, misses={self.miss}, "
228 f"capacity={self.capacity}, current size={self.num_keys})"
229 )
230
231 def __contains__(self, key: T) -> bool:
232 """

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected