1
我正在使用Google App Engine和NDB。爲了簡潔,我刪除了很多代碼,但保留了基本問題。我發現了一個錯誤'list' object has no attribute 'get_result'
爲什麼這個Python函數不會返回未來?
def get_future(keys):
future = ndb.get_multi_async(keys)
important_value = ... # get important value
return {"future" : future, "value" : important_value}
dic = get_future(keys)
future = dic['future']
# error `'list' object has no attribute 'get_result'`
items = future.get_result()
爲什麼我會得到一個列表回來時,我應該得到一個未來?