dict
objects are mutable one-to-one mappings from a set of key objects to a set of value objects. The association between a key-value pair is also called item.
The items contained in a dict
object have no order that is predictable.
The underlying data structure of the dict
type are hash tables. They make key look-ups extremely fast by converting the items' keys into deterministic hash values specifiying precisely one of a fixed number of equally "wide" buckets in which an item's references are stored. A limitation is that objects used as keys must be immutable (for technical reasons) and unique (for practical reasons).
A set
object is a mutable and unordered collection of immutable objects. The set
type mimics sets we know from math.