From: Paul Brossier Date: Tue, 16 Apr 2013 00:04:14 +0000 (-0500) Subject: timeside/analyzer/core.py: add __eq__ to AnalyzerResultContainer X-Git-Tag: 0.5.0~115^2~4 X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=9c48984bb4bb014bcae76ed46701bfa2285c240d;p=timeside.git timeside/analyzer/core.py: add __eq__ to AnalyzerResultContainer --- diff --git a/timeside/analyzer/core.py b/timeside/analyzer/core.py index 99ac45a..4e1a29c 100644 --- a/timeside/analyzer/core.py +++ b/timeside/analyzer/core.py @@ -91,6 +91,13 @@ class AnalyzerResultContainer(object): def __repr__(self): return self.to_json() + def __eq__(self, that): + if hasattr(that, 'results'): + that = that.results + for a, b in zip(self.results, that): + if a != b: return False + return True + def add_result(self, analyzer_result): if type(analyzer_result) == list: for a in analyzer_result: