在我的FUNC,我有:類的實例並不可迭代
"""
Iterates 300 times as attempts, each having an inner-loop
to calculate the z of a neighboring point and returns the optimal
"""
pointList = []
max_p = None
for attempts in range(300):
neighborList = ((x - d, y), (x + d, y), (x, y - d), (x, y + d))
for neighbor in neighborList:
z = evaluate(neighbor[0], neighbor[1])
point = None
point = Point3D(neighbor[0], neighbor[1], z)
pointList += point
max_p = maxPoint(pointList)
x = max_p.x_val
y = max_p.y_val
return max_p
我沒有遍歷我的類的實例,點,但無論如何,我得到:
pointList += newPoint
TypeError: 'Point3D' object is not iterable