Something in Sage changed and now we're getting Vector "rows" in what
used to be a list-of-lists resulting from a block matrix. Tweak the
test to support anything with a __len__ method inside, rather than
just list or tuple.
+from collections.abc import Sized
+
from sage.misc.table import table
from sage.categories.magmatic_algebras import MagmaticAlgebras
from sage.misc.cachefunc import cached_method
nrows = len(entries)
ncols = 0
if nrows > 0:
- if isinstance(entries[0], (list, tuple)):
+ # Support list, tuple, vector, etc. The "Sized" type class
+ # is what provides the __len__ we use immediately after.
+ if isinstance(entries[0], Sized):
ncols = len(entries[0])
else:
# We were given one long list of entries,