[New-bugs-announce] [issue27071] unittest.TestCase.assertCountEqual is a very misleading name

Vitaly report at bugs.python.org
Fri May 20 19:53:00 EDT 2016


New submission from Vitaly:

Somewhere in 3.x assertItemsEqual was renamed to assertCountEqual.

assertCountEqual sounds like a really inappropriate, misleading name for what it does. It misleads users into thinking that it only compares the number of elements in each sequence, whereas it actually asserts that equivalent items are present in both sequences, regardless of order. The original name from 2.7 assertItemsEqual was so much more meaningful.

----------
components: Library (Lib)
messages: 265980
nosy: vitaly
priority: normal
severity: normal
status: open
title: unittest.TestCase.assertCountEqual is a very misleading name
versions: Python 3.3, Python 3.4, Python 3.5, Python 3.6

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue27071>
_______________________________________


More information about the New-bugs-announce mailing list