metadsl.dict_tools

Functions

safe_merge(*mappings[, dict_constructor])

Combing mappings by merging the dictionaries.

Classes

HashableMapping(mapping)

Like a dictionary, but immutable and hashable.

Item(key, value)

UnhashableMapping(*items)

Like a dictionary, but can have unhashable keys.

class metadsl.dict_tools.HashableMapping(mapping)[source]

Like a dictionary, but immutable and hashable.

class metadsl.dict_tools.Item(key, value)[source]
key: metadsl.dict_tools.T
value: metadsl.dict_tools.V
class metadsl.dict_tools.UnhashableMapping(*items)[source]

Like a dictionary, but can have unhashable keys.

metadsl.dict_tools.safe_merge(*mappings, dict_constructor=<class 'dict'>)[source]

Combing mappings by merging the dictionaries. It raises a ValueError if there are duplicate keys and they are not equal.

Return type

Mapping[TypeVar(T), TypeVar(V)]