From 16c9e14a4db58611fea1bbd496233cf7409ef9fd Mon Sep 17 00:00:00 2001 From: Amr Hassan Date: Tue, 6 Oct 2009 14:27:24 +0000 Subject: [PATCH] each _BaseObject descendant has a unique __hash__ now --- .build | 2 +- pylast.py | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.build b/.build index ca7bf83..da2d398 100644 --- a/.build +++ b/.build @@ -1 +1 @@ -13 \ No newline at end of file +14 \ No newline at end of file diff --git a/pylast.py b/pylast.py index 5720595..7bbbd7c 100644 --- a/pylast.py +++ b/pylast.py @@ -1025,6 +1025,9 @@ class _BaseObject(object): """Returns the most common set of parameters between all objects.""" return {} + + def __hash__(self): + return hash(self.network) + hash("".join(self._get_params().keys() + self._get_params().values())) class _Taggable(object): """Common functions for classes with tags."""