From f42f2d82fadc146bf06153dfd3bb77220a30aaba Mon Sep 17 00:00:00 2001 From: wirawan Date: Tue, 5 Apr 2011 19:20:55 +0000 Subject: [PATCH] * __imul__ and __idiv__ should return the lvalue object itself. --- math/stats/errorbar.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/math/stats/errorbar.py b/math/stats/errorbar.py index 55aeafd..84fd27a 100644 --- a/math/stats/errorbar.py +++ b/math/stats/errorbar.py @@ -1,4 +1,4 @@ -# $Id: errorbar.py,v 1.3 2011-03-10 20:17:55 wirawan Exp $ +# $Id: errorbar.py,v 1.4 2011-04-05 19:20:55 wirawan Exp $ # # Module wpylib.math.stats.errorbar # Errorbar text handling for Python @@ -192,6 +192,7 @@ class errorbar(object): self.val *= y self.err *= abs(y) self.ebupdate() + return self def __div__(self, y): """Divides by a scalar value.""" return self.__class__(self.val/y, self.err/abs(y), ebproc=self.ebproc) @@ -200,6 +201,7 @@ class errorbar(object): self.val /= y self.err /= abs(y) self.ebupdate() + return self def __add__(self, y): """Adds by a scalar value or another errorbar value.