Перейти к основному содержимому

Protocol: ScriptStorage

Persistent key-value storage scoped to the current Script identity.

class ScriptStorage(Protocol)

Related API: DataValue

Methods

get

def get(self, key: str) -> DataValue:

Return the stored value, or None when the key is absent.

Related API: DataValue

set

def set(self, key: str, value: Optional[DataValue]=None) -> None:

Store a value; None removes the key.

Related API: DataValue

get_keys

def get_keys(self, prefix: Optional[str]='') -> Sequence[str]:

Return stored keys, optionally restricted to a prefix.

clear

def clear(self, prefix: Optional[str]='') -> None:

Remove every key matching the optional prefix.