From: Michael Orlitzky Date: Wed, 3 Mar 2021 04:55:54 +0000 (-0500) Subject: eja: fix _all2list() bug introduced in previous commit. X-Git-Url: http://gitweb.michael.orlitzky.com/?p=sage.d.git;a=commitdiff_plain;h=85b888f341dc02801ea19a95cd521676bb9c252a eja: fix _all2list() bug introduced in previous commit. --- 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) ), [])