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

2017-03-24 Thread Xiang Zhang
Xiang Zhang added the comment: New changeset b2d77175d1317494b4238b4e07426d310fbf1d19 by Xiang Zhang in branch 'master': bpo-29756: Improve documentation for list methods that compare items by equality (GH-572) https://github.com/python/cpython/commit/b2d77175d1317494b4238b4e07426d310fbf1d19

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

2017-03-12 Thread Xiang Zhang
Changes by Xiang Zhang : -- resolution: -> fixed stage: -> resolved status: open -> closed versions: +Python 3.7 ___ Python tracker

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

2017-03-12 Thread Steven D'Aprano
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

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

2017-03-12 Thread Alexander Todorov
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

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

2017-03-08 Thread Xiang Zhang
Changes by Xiang Zhang : -- pull_requests: +468 ___ Python tracker ___ ___ Python-bugs-list

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

2017-03-08 Thread Xiang Zhang
Xiang Zhang added the comment: +1 for jsoh. Actually the behaviour is documented in https://docs.python.org/3/reference/expressions.html#value-comparisons. So a single 'a is b' or 'a == b' is not complete. I would like to use 'equal to' which implies 'a is b or a == b'. -- nosy:

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

2017-03-08 Thread Josh Rosenberg
Josh Rosenberg added the comment: Steven: Technically, in CPython, they use both identity and equality testing, as a function of using RichCompareBool (which tests identity first, then equality), rather than RichCompare (which only tests equality). It makes a difference for stuff like NaN

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

2017-03-08 Thread Steven D'Aprano
Steven D'Aprano added the comment: To be clear, I'm referring to the docs in the tutorial: https://docs.python.org/3.7/tutorial/datastructures.html and the docstrings as well as the library reference: https://docs.python.org/3.7/library/stdtypes.html#sequence-types-list-tuple-range The

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

2017-03-08 Thread Steven D'Aprano
Steven D'Aprano added the comment: Further to Barry's explanation, you see the same result with any values which compare equal: py> from decimal import Decimal as D py> [1, 1.0, D(1), True, 1+0j].count(D(1)) 5 This is standard behaviour for methods `count`, `remove`, and `index`, but it