From 3f20fe2334b0332de75e266ac14353e2eb7734a0 Mon Sep 17 00:00:00 2001 From: Andreas Kloeckner Date: Tue, 13 May 2008 00:44:44 -0400 Subject: [PATCH] Fix some zero tests. --- src/primitives.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/primitives.py b/src/primitives.py index 0b3d0be..e589800 100644 --- a/src/primitives.py +++ b/src/primitives.py @@ -355,9 +355,9 @@ class Product(Expression): return NotImplemented if isinstance(other, Product): return Product(self.children + other.children) - if not other: + if is_zero(other): return 0 - if not other-1: + if is_zero(other-1): return self return Product(self.children + (other,)) @@ -366,9 +366,9 @@ class Product(Expression): return NotImplemented if isinstance(other, Product): return Product(other.children + self.children) - if not other: + if is_zero(other): return 0 - if not other-1: + if is_zero(other-1): return self return Product((other,) + self.children) -- GitLab