Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make super() calls Python 2 compatible. #1312

Merged
merged 1 commit into from
Feb 7, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion gym/spaces/box.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def __init__(self, low=None, high=None, shape=None, dtype=None):
logger.warn("gym.spaces.Box autodetected dtype as {}. Please provide explicit dtype.".format(dtype))
self.low = low.astype(dtype)
self.high = high.astype(dtype)
super().__init__(shape, dtype)
super(Box, self).__init__(shape, dtype)
self.np_random = np.random.RandomState()

def seed(self, seed):
Expand Down
2 changes: 1 addition & 1 deletion gym/spaces/dict_space.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def __init__(self, spaces=None, **spaces_kwargs):
if isinstance(spaces, list):
spaces = OrderedDict(spaces)
self.spaces = spaces
super().__init__(None, None) # None for shape and dtype, since it'll require special handling
super(Dict, self).__init__(None, None) # None for shape and dtype, since it'll require special handling

def seed(self, seed):
[space.seed(seed) for space in self.spaces.values()]
Expand Down
2 changes: 1 addition & 1 deletion gym/spaces/discrete.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class Discrete(Space):
"""
def __init__(self, n):
self.n = n
super().__init__((), np.int64)
super(Discrete, self).__init__((), np.int64)
self.np_random = np.random.RandomState()

def seed(self, seed):
Expand Down
2 changes: 1 addition & 1 deletion gym/spaces/multi_binary.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
class MultiBinary(Space):
def __init__(self, n):
self.n = n
super().__init__((self.n,), np.int8)
super(MultiBinary, self).__init__((self.n,), np.int8)
self.np_random = np.random.RandomState()

def seed(self, seed):
Expand Down
2 changes: 1 addition & 1 deletion gym/spaces/multi_discrete.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def __init__(self, nvec):
assert (np.array(nvec) > 0).all(), 'nvec (counts) have to be positive'
self.nvec = np.asarray(nvec, dtype=np.uint32)

super().__init__(self.nvec.shape, np.uint32)
super(MultiDiscrete, self).__init__(self.nvec.shape, np.uint32)
self.np_random = np.random.RandomState()

def seed(self, seed):
Expand Down
2 changes: 1 addition & 1 deletion gym/spaces/tuple_space.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class Tuple(Space):
"""
def __init__(self, spaces):
self.spaces = spaces
super().__init__(None, None)
super(Tuple, self).__init__(None, None)

def seed(self, seed):
[space.seed(seed) for space in self.spaces]
Expand Down