From e27cd9e809d8d7c711662c6f9020f3e6c6ea9a15 Mon Sep 17 00:00:00 2001 From: Steven Armstrong Date: Mon, 10 Oct 2011 09:23:27 +0200 Subject: [PATCH] when comparing objects, define equality as 'attributes are the same' Signed-off-by: Steven Armstrong --- lib/cdist/core/object.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/cdist/core/object.py b/lib/cdist/core/object.py index 12d16838..b6bdeee3 100644 --- a/lib/cdist/core/object.py +++ b/lib/cdist/core/object.py @@ -80,6 +80,10 @@ class Object(object): def __repr__(self): return '' % self.name + def __eq__(self, other): + """define equality as 'attributes are the same'""" + return self.__dict__ == other.__dict__ + @property def explorer_path(self): # create absolute path