X-Git-Url: http://gitweb.michael.orlitzky.com/?a=blobdiff_plain;f=mjo%2Feja%2Feja_utils.py;h=6690a80d395f000e3d8e588b3c0d407f8b7678c6;hb=85b888f341dc02801ea19a95cd521676bb9c252a;hp=430113d5cddaede7074ca9798f7f3f920a3e93ab;hpb=b0044b0f4a417ecbdf72a9d13b268fd7f94694de;p=sage.d.git diff --git a/mjo/eja/eja_utils.py b/mjo/eja/eja_utils.py index 430113d..6690a80 100644 --- a/mjo/eja/eja_utils.py +++ b/mjo/eja/eja_utils.py @@ -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) ), [])