[issue27060] Documentation of assertItemsEqual in unittest is VERY misleading in 2.7

2016-05-20 Thread Vitaly
Vitaly added the comment: ... and an unnecessary incompatibility between 2.7 and 3.x -- ___ Python tracker ___

[issue27060] Documentation of assertItemsEqual in unittest is VERY misleading in 2.7

2016-05-20 Thread Vitaly
Vitaly added the comment: Yes, this caused me to examine Counter, which I had not used before, and now I understand it, too. However, the new name by itself does not sufficiently reflect the subtlety of element-by-element counts, which does a disservice to the readability of test code.

[issue27060] Documentation of assertItemsEqual in unittest is VERY misleading in 2.7

2016-05-20 Thread Terry J. Reedy
Terry J. Reedy added the comment: It compares element by element counts, as indicated by "Equivalent to: assertEqual(Counter(list(first)), Counter(list(second))) ..." and the failure messages. Since I understand Counter equality, I ignore the rest. -- resolution: -> not a bug stage:

[issue27060] Documentation of assertItemsEqual in unittest is VERY misleading in 2.7

2016-05-20 Thread Vitaly
Vitaly added the comment: I think that we can close this as not a bug, as concerning 2.7. However, I think that 3.x made the wrong decision when it renamed assertItemsEqual with assertCountEqual, which now misleads users into thinking that it compares counts. --

[issue27060] Documentation of assertItemsEqual in unittest is VERY misleading in 2.7

2016-05-20 Thread Vitaly
Vitaly added the comment: Thanks Terry, your assessment is correct. The maintainers appear to have drawn the wrong conclusion in #17866, which mislead me about the existing assertItemsEqual in 2.7, which appears to work correctly after all! import unittest as u class Test(u.TestCase): def

[issue27060] Documentation of assertItemsEqual in unittest is VERY misleading in 2.7

2016-05-20 Thread Vitaly
Vitaly added the comment: According to comment http://bugs.python.org/issue17866#msg188052 in #17866, the maintainers renamed `assertItemsEqual` to `assertCountEqual` somewhere in the 3.x development timeframe. They apparently latched on to the implementation of `assertItemsEqual` in 2.7.x,

[issue27060] Documentation of assertItemsEqual in unittest is VERY misleading in 2.7

2016-05-20 Thread Terry J. Reedy
Terry J. Reedy added the comment: Here is the specific test code so you can replace my lists with examples that you think malfunction. import unittest as u class Test(u.TestCase): def test_Count(self): self.assertItemsEqual([1,2,3], [1,2,4]) u.main() --

[issue27060] Documentation of assertItemsEqual in unittest is VERY misleading in 2.7

2016-05-20 Thread Terry J. Reedy
Terry J. Reedy added the comment: Note: 2.7 doc says that this is renamed assertCountEqual in 3.x. It was added in 2.7 and 3.2. The 3.x doc is essentially the same, but with this instead: "Equivalent to: assertEqual(Counter(list(first)), Counter(list(second))) ...". If the method

[issue27060] Documentation of assertItemsEqual in unittest is VERY misleading in 2.7

2016-05-19 Thread Georg Brandl
Changes by Georg Brandl : -- nosy: +michael.foord ___ Python tracker ___ ___

[issue27060] Documentation of assertItemsEqual in unittest is VERY misleading in 2.7

2016-05-19 Thread Vitaly
Changes by Vitaly : -- assignee: -> docs@python components: +Documentation nosy: +docs@python ___ Python tracker ___

[issue27060] Documentation of assertItemsEqual in unittest is VERY misleading in 2.7

2016-05-19 Thread Vitaly
Changes by Vitaly : -- versions: +Python 2.7 ___ Python tracker ___ ___

[issue27060] Documentation of assertItemsEqual in unittest is VERY misleading in 2.7

2016-05-19 Thread Vitaly
New submission from Vitaly: Python 2.7 documentation is VERY misleading about the functionality of assertItemsEqual. The implementation only compares item counts, but the documentation actually claims to compare not only the counts, but the actual sorted elements themselves. This