summaryrefslogtreecommitdiffstats
path: root/Lib/collections/__init__.py
diff options
context:
space:
mode:
authorRaymond Hettinger <rhettinger@users.noreply.github.com>2019-02-21 17:19:00 (GMT)
committerGitHub <noreply@github.com>2019-02-21 17:19:00 (GMT)
commit407c7343266eb3e5a2f5c1f4913082c84f8dd8a0 (patch)
treeec7a7cf9dc5bbcd4ecdd1b92475e6953632c67fd /Lib/collections/__init__.py
parent86f093f71a594dcaf21b67ba13dda72863e9bde9 (diff)
downloadcpython-407c7343266eb3e5a2f5c1f4913082c84f8dd8a0.zip
cpython-407c7343266eb3e5a2f5c1f4913082c84f8dd8a0.tar.gz
cpython-407c7343266eb3e5a2f5c1f4913082c84f8dd8a0.tar.bz2
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/__init__.py')
-rw-r--r--Lib/collections/__init__.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/collections/__init__.py b/Lib/collections/__init__.py
index d88c4aa..632a509 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