Tips and Traps¶
Starting from Python 3.7,
dictpreserves insertion order (i.e.,dictis ordered). There is no need to useOrderedDictany more in Python 3.7+. However,setin Python is implemented as an unordered hashset and thus is neither ordered nor sorted. A trick to dedup an iterablevalues