structs.maps module¶
- class structs.maps.Dict[source]¶
Bases: dict
Overriden dict type with iadd functionality which will allow you to append two dictionaries together. ie:
>>> d = Dict(a=1, b=2) >>> d += {'c': 3, 'd': 4} >>> d
... {‘a’: 1, ‘b’: 2, ‘c’: 3, ‘d’: 4}
- class structs.maps.BiDirectionalMap(iterable=None, **kwargs)[source]¶
Bases: structs.maps.Dict
a bidirectional map, or hash bag, is an associative data structure in which the (key, value) pairs form a one-to-one correspondence. Thus the binary relation is functional in each direction: value can also act as a key to key. A pair (a, b) thus provides a unique coupling between a and b so that b can be found when a is used as a key and a can be found when b is used as a key.
- class structs.maps.MultiMap[source]¶
Bases: structs.maps.Dict
A MultiMap is a generalization of a dict type in which more than one value may be associated with and returned for a given key