为什么有这么多不同的方法来测试字典?测试对象是否是字典的最现代方法是什么?
adict = {'a': 1}
In [10]: isinstance(adict, types.DictType)
Out[10]: True
In [11]: isinstance(adict, types.DictionaryType)
Out[11]: True
In [12]: isinstance(adict, dict)
Out[12]: True
In [13]: isinstance(adict, collections.Mapping)
Out[13]: True
In [14]: isinstance(adict, collections.MutableMapping)
Out[14]: True