Dictionary keys must be hashable and equatable, i.e., must implement the Hashable and Equatable interfaces.
Hashable
Equatable
Most of the built-in types, like booleans and integers, are hashable and equatable, so can be used as keys in dictionaries.
Last updated 5 years ago