Package genlayer.py.storage.tree_map#

Warning

This is an internal module

class genlayer.py.storage.tree_map.Comparable[source]#
__init__(*args, **kwargs)#
abstract __lt__(other: Any, /) bool[source]#

Return self<value.

Return type:

bool

class genlayer.py.storage.tree_map.TreeMap[source]#

Represents a mapping from keys to values that can be persisted on the blockchain

Tparam K:

must implement genlayer.py.storage.tree_map.Comparable protocol (“<” is needed) and be storage-allowed

Tparam V:

must be storage-allowed

__repr__() str[source]#

Return repr(self).

Return type:

str

clear() None.  Remove all items from D.[source]#
compute_if_absent(k: K, supplier: Callable[[], V]) V[source]#
Returns:

Value associated with k if it is present, otherwise get’s new value from the supplier, stores it at k and returns

Return type:

V

get(k: K, /) V | None[source]#
get(k: K, /, default: G) V | G
Returns:

Value associated with k or default if there is no such value

items() a set-like object providing a view on D's items[source]#
Return type:

ItemsView