는 :파이썬 unhashable 유형 : 나는의 개념에 익숙하지 않은 전혀 아니다 'OrderedDict'
TypeError: unhashable type: 'OrderedDict'
하지만 코드의 다음 줄은 이러한 스택 추적을 생성 할 수있는 방법을 이해할 수 없습니다.
89: @staticmethod
90: def diff(var1, var2, path=[], level=0, curpath=[]):
...
101: elif isinstance(var1, list) and isinstance(var2, list):
102: l1s = set(var1)
103: l2s = set(var2)
104: retlist = []
File "myFile.py", line 102, in diff
l1s = set(var1)
TypeError: unhashable type: 'OrderedDict'
위의 코드에서 102
은 어떻게 이러한 예외가 발생합니까?
'var1'은'OrderedDict's의 목록입니다. –
제쳐두고, http://stackoverflow.com/questions/1132941/least-astonishment-in-python-the-mutable-default-argument – mgilson
@PavelAnossov를보고 싶을 수도 있습니다. 나는 머리를 치고 있습니다. 지금 내 책상 :) 고마워, 내가 어떻게 그리워하는지 모르겠다! – theAlse