提交 4f284ca6 authored 作者: Ian Goodfellow's avatar Ian Goodfellow

gave NullType eq and hash methods

(didn't I do this before? did the rebase lose them somehow?)
上级 90aefc28
...@@ -29,3 +29,9 @@ class NullType(Type): ...@@ -29,3 +29,9 @@ class NullType(Type):
def values_eq(a, b, force_same_dtype=True): def values_eq(a, b, force_same_dtype=True):
raise ValueError("NullType has no values to compare") raise ValueError("NullType has no values to compare")
def __eq__(self, other):
return type(self) == type(other)
def __hash__(self,other):
return hash(type(self))
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论