From 801f68fefc83e1bda2ea9e80ecb1c7c8c178d153 Mon Sep 17 00:00:00 2001 From: Philipp Schlegel Date: Fri, 30 Aug 2024 12:44:59 +0100 Subject: [PATCH] CatmaidInstance: add custom hash function --- pymaid/client.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pymaid/client.py b/pymaid/client.py index 0148daa..fa438b1 100644 --- a/pymaid/client.py +++ b/pymaid/client.py @@ -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,