在下面的代碼d_arr是字典Python字典錯誤
def process_data(d_arr):
flag2 = 0
for dictionaries in d_arr:
for k in dictionaries:
if (k == "*TYPE"):
""" Here we determine the type """
if (dictionaries[k].lower() == "name"):
dictionaries.update({"type" : 0})
func = name(dictionaries)
continue
elif (dictionaries[k].lower() == "ma"):
dictionaries.update({"type" : 1})
func = DCC(dictionaries)
logging.debug(type(func))
continue
數組當上面做我得到一個錯誤說
for k in dictionaries:
RuntimeError: dictionary changed size during iteration
2010-08-02 05:26:44,167 DEBUG Returning
是該禁做這樣的事情
非常有用的提示。 – Hulk 2010-08-02 05:42:30
男人你如何找到時間?你喜歡,實際上閱讀所有的代碼。 – Triptych 2010-08-02 08:29:30