betty.collection.keyed.error module

Keyed collection proxies that raise custom errors.

class betty.collection.keyed.error.ErroringKeyedCollection

Bases: KeyedCollectionProxy, Generic

A keyed collection proxy that raises custom errors.

__init__(upstream: KeyedCollection, key_error: Callable[[KeyError, KeyT | ResolvableKeyT], KeyError], /)
class betty.collection.keyed.error.MutableErroringKeyedCollection

Bases: ErroringKeyedCollection, MutableKeyedCollectionProxy, Generic

A mutable keyed collection proxy that raises custom errors.

remove(*keys: KeyT | ResolvableKeyT) None

Remove one or more keys from the collection.