Tips and Traps¶
Starting from Python 3.7,
dict
preserves insertion order (i.e.,dict
is ordered). There is no need to useOrderedDict
any more in Python 3.7+. However,set
in Python is implemented as an unordered hashset and thus is neither ordered nor sorted. A trick to dedup an iterablevalues
Differences Between Vector and ArrayList in Java
A good summay is here.