Package genlayer.py.storage.tree_map#

Warning

This is an internal module

class genlayer.py.storage.tree_map.Comparable[source]#
__init__(*args, **kwargs)#
class genlayer.py.storage.tree_map.TreeMap[source]#

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

K must implement genlayer.py.storage.tree_map.Comparable protocol (“<” and “=” are needed)

__init__()[source]#

This class can’t be created with TreeMap()

Raises:

TypeError – always

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, default: G = None) V | G[source]#
Returns:

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

Return type:

V | G

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

ItemsView