[issue29756] Improve documentation for list methods that compare items by equality

Alexander Todorov added the comment: Hi folks, I have another very similar issue, it could be the same root cause. Let me know if it is. assert 3 == 3.0 will pass self.assertEqual(3, 3.0) - will pass this had the nasty side effect of my test suite not catching a problem with SUT. I have updated the test suite to validate the result type as well but want to know how to file this use-case. ---------- _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue29756> _______________________________________

Steven D'Aprano added the comment: I'm afraid I don't know what SUT means. But 3 == 3.0 is the correct and expected behaviour. If you need to check that two values are both the same type and the same value, you have to validate the type and value separately. Changing the behaviour of == is ruled out for backwards compatability, but perhaps you could suggest a new === operator to check type and value. That would require some discussion on the Python Ideas mailing list, not just a feature request on the tracker. ---------- _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue29756> _______________________________________
participants (2)
-
Alexander Todorov
-
Steven D'Aprano