On Tue, Dec 22, 2020 at 11:44 PM Alan G. Isaac <alan.is...@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]])

-- 
The dead increasingly dominate and strangle both the living and the
not-yet born.  Vampiric capital and undead corporate persons abuse
the lives and control the thoughts of homo faber. Ideas, once born,
become abortifacients against new conceptions.
_______________________________________________
Python-Dev mailing list -- python-dev@python.org
To unsubscribe send an email to python-dev-le...@python.org
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at 
https://mail.python.org/archives/list/python-dev@python.org/message/VMKUC6LDGDPURJ5PN7T7FKOASN2M4NZR/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to