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

Method __repr__

other/lfu_cache.py:207–216  ·  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

205 self.cache: dict[T, DoubleLinkedListNode[T, U]] = {}
206
207 def __repr__(self) -> str:
208 """
209 Return the details for the cache instance
210 [hits, misses, capacity, current_size]
211 """
212
213 return (
214 f"CacheInfo(hits={self.hits}, misses={self.miss}, "
215 f"capacity={self.capacity}, current_size={self.num_keys})"
216 )
217
218 def __contains__(self, key: T) -> bool:
219 """

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected