]> gitweb.michael.orlitzky.com - sage.d.git/commitdiff
eja: fix _all2list() bug introduced in previous commit.
authorMichael Orlitzky <michael@orlitzky.com>
Wed, 3 Mar 2021 04:55:54 +0000 (23:55 -0500)
committerMichael Orlitzky <michael@orlitzky.com>
Wed, 3 Mar 2021 04:56:50 +0000 (23:56 -0500)
mjo/eja/eja_utils.py

index 430113d5cddaede7074ca9798f7f3f920a3e93ab..6690a80d395f000e3d8e588b3c0d407f8b7678c6 100644 (file)
@@ -58,6 +58,11 @@ def _all2list(x):
 
     EXAMPLES::
 
+        sage: _all2list([[1]])
+        [1]
+
+    ::
+
         sage: V1 = VectorSpace(QQ,2)
         sage: V2 = MatrixSpace(QQ,2)
         sage: x1 = V1([1,1])
@@ -96,9 +101,9 @@ def _all2list(x):
     except TypeError: # x is not iterable
         return [x]
 
-    if len(xl) == 1:
+    if xl == [x]:
         # Avoid the retardation of list(QQ(1)) == [1].
-        return xl
+        return [x]
 
     return sum(list( map(_all2list, xl) ), [])