spaces equality fixes and tests (#1375)

* spaces equality fixes and tests

* squash-merged master

* added better equality tests and more checks against bad space creation
This commit is contained in:
pzhokhov
2019-03-23 23:18:19 -07:00
committed by GitHub
parent b219d36441
commit 07645bd11e
7 changed files with 33 additions and 6 deletions

View File

@@ -34,4 +34,4 @@ class Discrete(Space):
return "Discrete(%d)" % self.n
def __eq__(self, other):
return self.n == other.n
return isinstance(other, Discrete) and self.n == other.n