我需要创建一个扩展dict的类,然后遇到一个有趣的问题,如下图所示.
为什么d.update()忽略班级__getitem__?
d.update()
__getitem__
编辑:这是在python2.7,它似乎不包含collections.UserDict思考UserDict.UserDict相当于我试过这个,它越来越接近,但仍然有趣的行为.
python dictionary python-2.7
dictionary ×1
python ×1
python-2.7 ×1