Skip to content

Commit

Permalink
CatmaidInstance: add custom hash function
Browse files Browse the repository at this point in the history
  • Loading branch information
schlegelp committed Aug 30, 2024
1 parent 40b3733 commit 801f68f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pymaid/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -609,6 +609,10 @@ def __copy__(self):
def __deepcopy__(self):
return self.copy()

def __hash__(self):
"""Hash based on server, api_token, http user, http password and project_id."""
return hash((self.server, self.api_token, self.http_user, self.http_password, self.project_id))

def copy(self):
"""Returns a copy of this CatmaidInstance. Does not copy cache."""
return CatmaidInstance(server=self.server,
Expand Down

0 comments on commit 801f68f

Please sign in to comment.