From 7d91a9acace8d334a745be33a0c12688bbc9c34c Mon Sep 17 00:00:00 2001 From: Amr Hassan Date: Tue, 6 Oct 2009 14:37:31 +0000 Subject: [PATCH] _BaseObject.__hash__() now includes a type indentifier --- .build | 2 +- pylast.py | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/.build b/.build index da2d398..3f10ffe 100644 --- a/.build +++ b/.build @@ -1 +1 @@ -14 \ No newline at end of file +15 \ No newline at end of file diff --git a/pylast.py b/pylast.py index 7bbbd7c..240cda1 100644 --- a/pylast.py +++ b/pylast.py @@ -373,6 +373,13 @@ class Network(object): return Country(country_name, self) + def get_group(self, name): + """ + Returns a Group object + """ + + return Group(name, self) + def get_user(self, username): """ Returns a user object @@ -1027,7 +1034,8 @@ class _BaseObject(object): return {} def __hash__(self): - return hash(self.network) + hash("".join(self._get_params().keys() + self._get_params().values())) + return hash(self.network) + \ + hash(str(type(self)) + "".join(self._get_params().keys() + self._get_params().values())) class _Taggable(object): """Common functions for classes with tags."""