From 64eff383494e5f1bb859247c2f73e6816f5804a1 Mon Sep 17 00:00:00 2001 From: Andreas Kloeckner <inform@tiker.net> Date: Thu, 27 Nov 2014 18:50:41 -0600 Subject: [PATCH] Py3 fix for geometric algebra non-zero-ness --- pymbolic/geometric_algebra/__init__.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pymbolic/geometric_algebra/__init__.py b/pymbolic/geometric_algebra/__init__.py index d52cdca..0934410 100644 --- a/pymbolic/geometric_algebra/__init__.py +++ b/pymbolic/geometric_algebra/__init__.py @@ -897,9 +897,11 @@ class MultiVector(object): return result - def __nonzero__(self): + def __bool__(self): return bool(self.data) + __nonzero__ = __bool__ + def __eq__(self, other): other = _cast_or_ni(other, self.space) if other is NotImplemented: -- GitLab