On Tue, Dec 22, 2020 at 11:44 PM Alan G. Isaac alan.isaac@gmail.com wrote:
My question is not about work arounds. It is about whether the current definition of a sequence (in collections.abc) should govern `assertSequenceEqual`.
Why do you think a NumPy array is a sequence?
E.g.:
a
array([[1, 2], [3, 4]])
b
[1, 2]
len(a) = len(b)
Ok, I suppose if you then loop through indices, you indeed get different things. But N-dimensional arrays aren't "indexed by an integer" except in the sense of an edge case. I've always read the Glossary as more narrowly "element access using ONLY integer indices."
Moreover, if you propose to ignore `==` comparison and always loop, will you do so recursively? What about:
assertSequenceEqual(a, [[1,2], [3,4]])