betty.collection.keyed.adapter module¶
Adapters between keyed collections and Python data types.
- class betty.collection.keyed.adapter.KeyedCollectionAdapter¶
Bases:
KeyedCollection,GenericA collection of values that are accessible by their primary keys.
- __init__(values: ~collections.abc.Mapping | ~collections.abc.Iterable[tuple[KeyT, ValueT]] | None = None, *, key_resolver: ~collections.abc.Callable[[ResolvableKeyT | KeyT], KeyT] = <function passthrough>)¶
- class betty.collection.keyed.adapter.MutableKeyedCollectionAdapter¶
Bases:
KeyedCollectionAdapter,MutableKeyedCollection,GenericA mutable ordered collection of values that are accessible by their primary keys.
- __init__(values: ~collections.abc.Iterable = (), *, key: ~collections.abc.Callable[[ValueT], KeyT], key_resolver: ~collections.abc.Callable[[ResolvableKeyT | KeyT], KeyT] = <function passthrough>, value_resolver: ~collections.abc.Callable[[ResolvableValueT | ValueT], ValueT] = <function passthrough>)¶