diff --git a/gym/core.py b/gym/core.py index 7ea21433b..f65905145 100644 --- a/gym/core.py +++ b/gym/core.py @@ -215,7 +215,8 @@ class Space(object): """ raise NotImplementedError - __contains__ = contains + def __contains__(self, x): + return self.contains(x) def to_jsonable(self, sample_n): """Convert a batch of samples from this space to a JSONable data type."""