polymerist.genutils.containers ============================== .. py:module:: polymerist.genutils.containers .. autoapi-nested-parse:: Custom data containers with useful properties Attributes ---------- .. autoapisummary:: polymerist.genutils.containers.T Classes ------- .. autoapisummary:: polymerist.genutils.containers.RecursiveDict polymerist.genutils.containers.UnorderedRegistry Module Contents --------------- .. py:data:: T .. py:class:: RecursiveDict(*args, **kwargs) Bases: :py:obj:`collections.defaultdict` A defaultdict which can be recursively nested indefinitely .. py:class:: UnorderedRegistry(*defaults: Iterable[T]) For storing and comparing unordered collections of items .. py:attribute:: elements :type: list[collections.Counter] :value: [] .. py:method:: input_as_counter() For transmuting the first input to a method into a counter .. py:method:: insert(elem: T) -> None Add a new element to the registry, avoiding duplication .. py:method:: pop(elem: T) -> T Removes a registered element from the UnoderedRegistry and returns it; Raises KeyError if the element was never registered in the first place .. py:method:: clear() -> None Empty all registered elements .. py:method:: reset() -> None Clear contents and restore initialized defaults