TypeError: unhashable type: 'Board'
时间: 2023-11-11 16:37:58 浏览: 123
Python 出现错误TypeError: ‘NoneType’ object is not iterable解决办法
This error occurs when you try to use a mutable object, such as a list or a dictionary, as a key in a dictionary or as an element in a set. Since mutable objects can be modified, their hash value can change, which would make it impossible to retrieve them from a dictionary or set.
In the case of the error message you provided, it seems that you are trying to use a Board object as a key in a dictionary or as an element in a set. To fix this error, you need to make sure that the Board object is immutable, or use a different data structure that can handle mutable objects.
阅读全文