betty.collection.mapping module¶
Mapping types and implementations.
- class betty.collection.mapping.MutableResolvedMapping¶
Bases:
MutableMapping,MutableCollection,ResolvedMapping,GenericA mutable mapping of resolvable keys and values.
- abstractmethod pop(key: KeyT | ResolvableKeyT, /) ValueT¶
- abstractmethod pop(key: KeyT | ResolvableKeyT, /, default: ValueT | ResolvableValueT) ValueT
- abstractmethod pop(key: KeyT | ResolvableKeyT, /, default: T) ValueT | T
D.pop(k[,d]) -> v, remove specified key and return the corresponding value. If key is not found, d is returned if given, otherwise KeyError is raised.
- abstractmethod popitem() (k, v), remove and return some (key, value) pair¶
as a 2-tuple; but raise KeyError if D is empty.
- abstractmethod setdefault(key: KeyT | ResolvableKeyT, default: None = None, /) T | None¶
- abstractmethod setdefault(key: KeyT | ResolvableKeyT, default: ValueT | ResolvableValueT, /) ValueT
D.setdefault(k[,d]) -> D.get(k,d), also set D[k]=d if k not in D
- abstractmethod update(other: Mapping[KeyT | ResolvableKeyT, ValueT | ResolvableValueT] | Iterable[tuple[KeyT | ResolvableKeyT, ValueT | ResolvableValueT]], /, **kwargs: ValueT | ResolvableValueT) None¶
- abstractmethod update(**kwargs: ValueT | ResolvableValueT) None
Update the mapping with the provided values.
See
collections.abc.MutableMapping.update().
- class betty.collection.mapping.ResolvedMapping¶
-
A mutable mapping of resolvable keys.