From: Michael Orlitzky Date: Tue, 23 Feb 2021 14:02:43 +0000 (-0500) Subject: eja: fix element constructor error message for Cartesian products. X-Git-Url: https://gitweb.michael.orlitzky.com/?a=commitdiff_plain;h=1cdc6f6bf992dc522ff144b1e624c9e92c95c0b9;p=sage.d.git eja: fix element constructor error message for Cartesian products. --- diff --git a/mjo/eja/eja_algebra.py b/mjo/eja/eja_algebra.py index 0653396..7fb8027 100644 --- a/mjo/eja/eja_algebra.py +++ b/mjo/eja/eja_algebra.py @@ -3157,8 +3157,11 @@ class CartesianProductEJA(CombinatorialFreeModule_CartesianProduct, e(0, 1) + e(1, 2) """ m = len(self.cartesian_factors()) - z = tuple( self.cartesian_factors()[i](elt[i]) for i in range(m) ) - return self._cartesian_product_of_elements(z) + try: + z = tuple( self.cartesian_factors()[i](elt[i]) for i in range(m) ) + return self._cartesian_product_of_elements(z) + except: + raise ValueError("not an element of this algebra") Element = FiniteDimensionalEJAElement