Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Changes to hashable dict #482

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

Merged
merged 7 commits into from
Apr 12, 2017
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
1 change: 0 additions & 1 deletion text.py
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,6 @@ def actions(self, state):

def result(self, state, action):
new_state = hashabledict(state) # copy to prevent hash issues
assert type(new_state) == hashabledict
new_state[action[0]] = action[1]
return new_state

Expand Down
8 changes: 4 additions & 4 deletions utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -579,19 +579,19 @@ def __hash__(self):
return hash(self.__tuplify__())

def __lt__(self, odict):
assert type(odict) is hashabledict
assert isinstance(odict, hashabledict)
return self.__tuplify__() < odict.__tuplify__()

def __gt__(self, odict):
assert type(odict) is hashabledict
assert isinstance(odict, hashabledict)
return self.__tuplify__() > odict.__tuplify__()

def __le__(self, odict):
assert type(odict) is hashabledict
assert isinstance(odict, hashabledict)
return self.__tuplify__() <= odict.__tuplify__()

def __ge__(self, odict):
assert type(odict) is hashabledict
assert isinstance(odict, hashabledict)
return self.__tuplify__() >= odict.__tuplify__()


Expand Down