提交 ca3ffe5f authored 作者: gdesjardins's avatar gdesjardins

Print op's hash method would fail when providing a list of attributes to Print.

attrs is unhashable since its a list. Fix is to first convert attrs to string than hash the string.
上级 48c21591
......@@ -107,7 +107,7 @@ class Print(Op):
return type(self)==type(other) and self.message==other.message and self.attrs==other.attrs
def __hash__(self):
return hash(self.message) ^ hash(self.attrs)
return hash(self.message) ^ hash(str(self.attrs))
class PrinterState(gof.utils.scratchpad):
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论