From 85b888f341dc02801ea19a95cd521676bb9c252a Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Tue, 2 Mar 2021 23:55:54 -0500 Subject: [PATCH] eja: fix _all2list() bug introduced in previous commit. --- mjo/eja/eja_utils.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) 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) ), []) -- 2.44.2