mirror of
https://github.com/Farama-Foundation/Gymnasium.git
synced 2025-08-30 01:50:19 +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:
@@ -20,8 +20,6 @@ class Tuple(gym.Space):
|
||||
return isinstance(x, tuple) and len(x) == len(self.spaces) and all(
|
||||
space.contains(part) for (space,part) in zip(self.spaces,x))
|
||||
|
||||
__contains__ = contains
|
||||
|
||||
def __repr__(self):
|
||||
return "Tuple(" + ", ". join([str(s) for s in self.spaces]) + ")"
|
||||
|
||||
|
Reference in New Issue
Block a user