X-Git-Url: http://gitweb.michael.orlitzky.com/?a=blobdiff_plain;f=mjo%2Feja%2Feja_element.py;h=4c9993a2cae68c8064a087c344ef2a5bf23877c5;hb=d6f51df5e37b30956849e01b70c4aede00f3434e;hp=7388e963ceaf42c0bdf41851e2b8019de5e69b3a;hpb=941a2733212f4d0072ea420265f83157222be564;p=sage.d.git diff --git a/mjo/eja/eja_element.py b/mjo/eja/eja_element.py index 7388e96..4c9993a 100644 --- a/mjo/eja/eja_element.py +++ b/mjo/eja/eja_element.py @@ -1651,8 +1651,6 @@ class CartesianProductEJAElement(FiniteDimensionalEJAElement): # product spaces, even though they provide a method # with that name. pairs = zip(B, self.to_vector()) - sigma = W.zero() - for (b,alpha) in pairs: - # sum(...) ALSO doesn't work on Cartesian products. - sigma += W(tuple(alpha*b_i for b_i in b)) - return sigma + return sum( ( W(tuple(alpha*b_i for b_i in b)) + for (b,alpha) in pairs ), + W.zero())