registtro package

class registtro.RegistryProtocol(*args, **kwds)

Bases: Protocol[_ET, _VT]

Protocol for registry-like interfaces.

update(updates)

Update entries.

query(entry)

Query value for entry.

Raises:

EntryNotFoundError – Entry not in the registry.

get(entry, fallback=None)

Get value for entry, return fallback value if not in the registry.

to_dict()

Convert to dictionary.

class registtro.Registry(initial=None)

Bases: SlottedBase, Generic[_ET, _VT]

Immutable weak entry/strong value registry.

update(updates)

Update entries.

query(entry)

Query value for entry.

Raises:

EntryNotFoundError – Entry not in the registry.

get(entry, fallback=None)

Get value for entry, return fallback value if not in the registry.

to_dict()

Convert to dictionary.

get_evolver()

Get mutable evolver.

class registtro.RegistryEvolver(registry=None)

Bases: SlottedBase, Generic[_ET, _VT]

Mutable registry evolver.

update(updates)

Update entries.

query(entry)

Query value for entry.

Raises:

EntryNotFoundError – Entry not in the registry.

get(entry, fallback=None)

Get value for entry, return fallback value if not in the registry.

to_dict()

Convert to dictionary.

get_registry()

Get immutable registry.

fork()

Fork into a new mutable evolver.

is_dirty()

Whether has updates that were not committed.

reset()

Reset updates to last commit.

commit()

Commit updates.

property updates

Updates.

exception registtro.RegisttroException

Bases: Exception

Base registtro exception.

exception registtro.EntryNotFoundError

Bases: RegisttroException

Queried entry is not in the registry.