Python 迭代dict 效率
摘要:
迭代dict也要讲求效率,不然就要走进性能陷阱以下三种迭代方式:keys,iterkeys, hashkeyimport timeitDICT_SIZE = 100 * 100000testDict = dict()for i in xrange(DICT_SIZE): testDict[i]... 阅读全文
posted @ 2015-03-07 13:34 庄泽波 阅读(553) 评论(0) 推荐(0) 编辑