小编Duk*_*uke的帖子

试图在 dict 上调用方法,得到 AttributeError: 'dict' object attribute 'update' is read-only

我不知道出了什么问题或导致错误的原因:

AttributeError: 'dict' object attribute 'update' is read-only
Run Code Online (Sandbox Code Playgroud)

在以下代码中:

map = []
point1back = {}
point1fwd = {}
point1back.update = {'nextHop':point1Fwd, 'direction':1, 'distance':0}
point1fwd.update = {'nextHop':point1Fwd, 'direction':3, 'distance':160}
map.append(point1back)
map.append(point1fwd)
Run Code Online (Sandbox Code Playgroud)

python dictionary attributeerror

5
推荐指数
1
解决办法
6599
查看次数

标签 统计

attributeerror ×1

dictionary ×1

python ×1