Skip to content

Commit

Permalink
add __setitem__ method to Dict action space (#2377)
Browse files Browse the repository at this point in the history
  • Loading branch information
jfpettit authored Sep 1, 2021
1 parent a004558 commit cf0cf17
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions gym/spaces/dict.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@ def contains(self, x):
def __getitem__(self, key):
return self.spaces[key]

def __setitem__(self, key, value):
self.spaces[key] = value

def __iter__(self):
for key in self.spaces:
yield key
Expand Down

0 comments on commit cf0cf17

Please sign in to comment.