protocols.kvstore.KeyValueStoreProtocol
A protocol for a key-value store.
Usage
protocols.kvstore.KeyValueStoreProtocol()Methods
| Name | Description |
|---|---|
| delete() | Delete the value for the given key. |
| exists() | Check if the given key exists. |
| get() | Retrieve the value for the given key. |
| set() | Set the value for the given key. |
delete()
Delete the value for the given key.
Usage
delete(key)Does nothing if there is no such value in the store.
exists()
Check if the given key exists.
Usage
exists(key)Default implementation for classes inheriting from this protocol. Providers can use something more efficient.
get()
Retrieve the value for the given key.
Usage
get(key, default=None)Returns the specified default value if there is no such value in the store.
set()
Set the value for the given key.
Usage
set(key, value)Providers must reject storing a value of None if they support a value domain V that can contain such values.