system.indexes.indexes module¶
Simple index implementation backed by a Python dictionary.
- class system.indexes.indexes.PythonDictionaryIndex[source]¶
Bases:
KeyValueStore,GenericA simple key-value store implemented using a Python dictionary (yes, a Python dictionary is a key/value store). Supports duplicates by mapping a key to a list of Values, i.e. multiple values can be associated with the same key.
- put(key: Key, value: Value) PutInfo | None[source]¶
See
Index.put().Appends the value to the list stored for the key, so duplicates are kept rather than overwritten.
- delete(key: Key, value: Value = None) None[source]¶
See
Index.delete().Removes the given value from the list stored for the key and drops the key entirely once its last value has been removed. Raises
KeyErrorif the key or the value is not present.