degenbot.types.concrete ======================= .. py:module:: degenbot.types.concrete .. autoapi-nested-parse:: Concrete type definitions (state caches). Module Contents --------------- .. py:class:: KeyedDefaultDict[KT, VT](default_factory: collections.abc.Callable[[KT], VT]) Bases: :py:obj:`collections.defaultdict`\ [\ :py:obj:`KT`\ , :py:obj:`VT`\ ] A modified defaultdict that passes the key to default_factory at runtime and records it. This differs from the defaultdict behavior, which calls default_factory with no arguments. .. py:class:: BoundedCache[KT, VT](max_items: int) Bases: :py:obj:`collections.OrderedDict`\ [\ :py:obj:`KT`\ , :py:obj:`VT`\ ] A cache holding key-value pairs, tracked by entry order. The cache automatically removes old. items if the number of items would exceed the maximum number of entries set by `max_items`. Setting a value at an existing key will overwrite that value without affecting ordering. .. py:attribute:: max_items .. py:method:: copy() -> Self Copy. :returns: The computed value.