如果我创建一个使用整数作为键的Python dict,我可以安全地假设迭代dict将根据键值按顺序检索项目吗?
即会
my_dict = {} for x in range(0,100): my_dict[x] = str(x) for item in my_dict.items(): print item
总是导致按键值顺序打印列表?
python dictionary integer key sorted
dictionary ×1
integer ×1
key ×1
python ×1
sorted ×1