On 1/8/2021 2:50 PM, Chris Barker via Python-Dev wrote:
If there are other common types this helps with, sure. But for numpy, as pointed out elsewhere in this thread, it would still fail for numpy arrays of > 1 dimension.

Personally I think this is really an issue with the structure of unitest -- 
having a custom assertion for every possibility is intractable.

If you want to test numpy arrays, use the utilities provided by numpy.


This comment misses the key point, which is:
`assertSequenceEqual` should not rely
on behavior that is not ensured for typing.Sequence,
but it currently does. The failure on a numpy array
simply exposes this problem.

The array-dimension consideration is also a red herring.
For example,
`unittest.TestCase().assertSequenceEqual([1,2,3],(1,2,3))`
pasess but
`unittest.TestCase().assertSequenceEqual([[1,2,3]],[(1,2,3)])`
raises. This behavior remains unchallenged.

Alan Isaac
_______________________________________________
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/2JGP3J7V4XVBS6KDFWNUZCVKIC3HO4YO/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to