RAIMAD

Class FilteredDictList from raimad.dictlist

class FilteredDictList
Base class for making containers that act like both list and dict.

FilteredDictList stores data in an internal dict,
but that data can also be accessed by index,
and by attribute notation.
FilteredDictList is an abstract class with two virtual
methods: _filter_set and _filter_get.
_filter_set takes any new item added to the list
(via assignment to attribute, assignment to key, or .append)
of generic type T_ADDED and transforms it to
generic type T_STORED,
which is what is actually stored in the encapsulated dict.
_filter_get takes an item of type T_STORED
and transforms it into T_RETURNED just before it
is returned from the list
(via getting an attribute, key, by index, or by iteration)

TODO raises, examples, link to dictlist
TODO explain how it is used in markscontainer, etc.
def __init__(self, dict_: dict[int | str, ~T_STORED] | None = None, *, copy: bool | None = None) -> None:
    """
    Initialize self.  See help(type(self)) for accurate signature.
    """
def __setitem__(self, key: int | str, val: ~T_ADDED) -> None:
    """
    Add or replace item in dictlist by key.
    """
def __getitem__(self, key: int | str) -> ~T_RETURNED:
    """
    Get item from dictlist by key.
    """
def __setattr__(self, name: str, val: ~T_ADDED) -> None:
    """
    Add item to dictlist by key with attr notation.
    """
def __getattr__(self, name: str) -> Union[~T_RETURNED, Any]:
    """
    Get item from dictlist by key with attr notation.
    """
def append(self, val: ~T_ADDED) -> None:
    """
    Add item to dictlist.
    """
def extend(self, items: Iterable[~T_ADDED]) -> None:
    """
    Add multiple items to dictlist.
    """
def __iter__(self) -> NoReturn:
    """
    Deliberately not implemented.

    Iterating through a dictlist is ambiguous.
    Use `.keys()`, `.values()`, or `.items()`.
    """
def items(self) -> Iterator[tuple[str | int, ~T_RETURNED]]:
    """
    Get iterator of key-value pairs in DictList.
    """
def values(self) -> Iterator[~T_RETURNED]:
    """
    Get values in DictList.
    """
def keys(self) -> KeysView[str | int]:
    """
    Get keys of DictList.
    """
def __len__(self) -> int:
    """
    Get number of items stored in DictList.
    """