mode.utils.collections
¶
Custom data structures.
-
class
mode.utils.collections.
FastUserDict
[source]¶ Proxy to dict.
Like
collection.UserDict
but reimplements some methods for better performance when the underlying dictionary is a real dict.-
classmethod
fromkeys
(iterable: Iterable[KT], value: VT = None) → mode.utils.collections.FastUserSet[source]¶
-
classmethod
-
class
mode.utils.collections.
LRUCache
(limit: int = None, *, thread_safety: bool = False)[source]¶ LRU Cache implementation using a doubly linked list to track access.
- Parameters
-
update
([E, ]**F) → None. Update D from mapping/iterable E and F.[source]¶ If E present and has a .keys() method, does: for k in E: D[k] = E[k] If E present and lacks .keys() method, does: for (k, v) in E: D[k] = v In either case, this is followed by: for k, v in F.items(): D[k] = v
-
class
mode.utils.collections.
ManagedUserSet
[source]¶ A MutableSet that adds callbacks for when keys are get/set/deleted.
-
class
mode.utils.collections.
ManagedUserDict
[source]¶ A UserDict that adds callbacks for when keys are get/set/deleted.
-
class
mode.utils.collections.
AttributeDictMixin
[source]¶ Mixin for Mapping interface that adds attribute access.
I.e., d.key -> d[key]).