我读过,列表不能是字典键,因为可变对象不能被散列。但是,自定义对象似乎也是可变的:class Vertex(object): self.key= key
v.color = 'grey' # this line suggests the custom object is mutable
但是,与列表不同的<
我有一个清单L = [1,2,3].lists:sublist(L,2) ++ [10] ++ lists:nthtail(3,L).与其将结果存储在新列表中,不如将结果存储在L中。然而,当我这样做时,我得到了一个明显的错误:** exception error: no match of right hand side value [1,2,300]
我不想使用新的</