]> gitweb.michael.orlitzky.com - sage.d.git/commitdiff
eja: document why an a[0] access is safe.
authorMichael Orlitzky <michael@orlitzky.com>
Fri, 6 Nov 2020 13:44:07 +0000 (08:44 -0500)
committerMichael Orlitzky <michael@orlitzky.com>
Fri, 6 Nov 2020 13:44:07 +0000 (08:44 -0500)
mjo/eja/eja_algebra.py

index 04929467d114dbb23cc4fcc15f11c80df58addf0..ded2df691d95eca3f4b9d25c8b0c77330b5b0c5a 100644 (file)
@@ -1006,8 +1006,10 @@ class MatrixEuclideanJordanAlgebra(FiniteDimensionalEuclideanJordanAlgebra):
             # we simply undo the basis_normalizer scaling that we
             # performed earlier.
             #
-            # TODO: make this access safe.
-            XS = a[0].variables()
+            # The a[0] access here is safe because trivial algebras
+            # won't have any basis normalizers and therefore won't
+            # make it to this "else" branch.
+            XS = a[0].parent().gens()
             subs_dict = { XS[i]: self._basis_normalizers[i]*XS[i]
                           for i in range(len(XS)) }
             return tuple( a_i.subs(subs_dict) for a_i in a )