betty.collection.mapping package¶
Submodules¶
Module contents¶
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
D.update([E, ]**F) -> None. Update D from mapping/iterable E and F. If E present and has a .keys() method, does: for k in E.keys(): 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 betty.collection.mapping.ResolvedMapping¶
-
A mutable mapping of resolvable keys.