mirror of
https://github.com/Farama-Foundation/Gymnasium.git
synced 2025-08-23 15:04:20 +00:00
rm unnecessary __contains__
duplicate code (#1147)
`contains` really should not exist when it does exactly what the builtin magic method `__contains__` was meant for, but that would break backward compatibility.
This commit is contained in:
@@ -38,8 +38,6 @@ class Box(gym.Space):
|
||||
def contains(self, x):
|
||||
return x.shape == self.shape and (x >= self.low).all() and (x <= self.high).all()
|
||||
|
||||
__contains__ = contains
|
||||
|
||||
def to_jsonable(self, sample_n):
|
||||
return np.array(sample_n).tolist()
|
||||
def from_jsonable(self, sample_n):
|
||||
|
Reference in New Issue
Block a user