EXAMPLES::
+ sage: _all2list([[1]])
+ [1]
+
+ ::
+
sage: V1 = VectorSpace(QQ,2)
sage: V2 = MatrixSpace(QQ,2)
sage: x1 = V1([1,1])
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) ), [])