diff options
author | 2019-02-21 09:19:00 -0800 | |
---|---|---|
committer | 2019-02-21 09:19:00 -0800 | |
commit | 407c7343266eb3e5a2f5c1f4913082c84f8dd8a0 (patch) | |
tree | ec7a7cf9dc5bbcd4ecdd1b92475e6953632c67fd /Lib/collections | |
parent | bpo-36060: Document how collections.ChainMap() determines iteration order (GH... (diff) | |
download | cpython-407c7343266eb3e5a2f5c1f4913082c84f8dd8a0.tar.gz cpython-407c7343266eb3e5a2f5c1f4913082c84f8dd8a0.tar.bz2 cpython-407c7343266eb3e5a2f5c1f4913082c84f8dd8a0.zip |
bpo-36057 Update docs and tests for ordering in collections.Counter [no behavior change] (#11962)
* Add tests for Counter order. No behavior change.
* Update docs and tests
* Fix doctest output and capitalization
Diffstat (limited to 'Lib/collections')
-rw-r--r-- | Lib/collections/__init__.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/collections/__init__.py b/Lib/collections/__init__.py index d88c4aaaee8..632a509d316 100644 --- a/Lib/collections/__init__.py +++ b/Lib/collections/__init__.py @@ -570,8 +570,8 @@ class Counter(dict): '''List the n most common elements and their counts from the most common to the least. If n is None, then list all element counts. - >>> Counter('abcdeabcdabcaba').most_common(3) - [('a', 5), ('b', 4), ('c', 3)] + >>> Counter('abracadabra').most_common(3) + [('a', 5), ('b', 2), ('r', 2)] ''' # Emulate Bag.sortedByCount from Smalltalk |