1、而使用OrderedDict時我們需要從collections模塊引入OrderedDict,Dict作為python內置的數據類型,所以可以直接使用;Python其它一些內置的數據類型,像str、int、list、tuple、dict。
2、python中字典Dict跟OrderedDict最大的區別就是:OrderedDict是有順序的,而Dict是無序的。
從OrderedDict源代碼中我們可以看出OrderedDict繼承Dict,並且(Dictionary that remembers insertion order)OrderedDict記錄插入的順序。