chicken_turtle_util.multi_dict

multi-dict utilities. Multi-dicts can map keys to multiple values.

A multi-dict (or multi map) is a dict that maps each key to one or more values.

MultiDict A multi-dict view of a {hashable => {hashable}} dict.
class chicken_turtle_util.multi_dict.MultiDict(dict_)[source]

A multi-dict view of a {hashable => {hashable}} dict.

A light wrapper offering a few methods for working with multi-dicts.

Parameters:

dict_ : {hashable => {hashable}}

Dict to access as a multi-dict

Notes

A multi-dict (or multi map) is a dict that maps each key to one or more values.

MultiDicts provided by other libraries tend to be more feature rich, while this interface is far more conservative. Instead of wrapping, they provide an interface that mixes regular and multi-dict access. Additionally, other MultiDict‘s map keys to lists of values, allowing a key to map to the same value multiple times.