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 1 commit
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
Prev Previous commit
uses isinstance
  • Loading branch information
Chipe1 committed Apr 7, 2017
commit 71694789564b9630a432c47628998053552a4074
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
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy