From: Jacob Coffee Date: Thu, 28 Sep 2023 02:29:39 +0000 (-0500) Subject: gh-109812: Fix phrasing for `collections.Counter` (gh-109813) X-Git-Tag: v3.13.0a1~259 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=99fba5f156386cf8f4a71321708690cdb9357ffc;p=thirdparty%2FPython%2Fcpython.git gh-109812: Fix phrasing for `collections.Counter` (gh-109813) --- diff --git a/Doc/library/collections.rst b/Doc/library/collections.rst index 03cb1dca8f81..43f4ff077b40 100644 --- a/Doc/library/collections.rst +++ b/Doc/library/collections.rst @@ -358,7 +358,7 @@ Common patterns for working with :class:`Counter` objects:: list(c) # list unique elements set(c) # convert to a set dict(c) # convert to a regular dictionary - c.items() # convert to a list of (elem, cnt) pairs + c.items() # access the (elem, cnt) pairs Counter(dict(list_of_pairs)) # convert from a list of (elem, cnt) pairs c.most_common()[:-n-1:-1] # n least common elements +c # remove zero and negative counts diff --git a/Misc/ACKS b/Misc/ACKS index aaa178fc3b5d..ccdfae66832f 100644 --- a/Misc/ACKS +++ b/Misc/ACKS @@ -349,6 +349,7 @@ Robbie Clemons Steve Clift Hervé Coatanhay Riccardo Coccioli +Jacob Coffee Nick Coghlan Josh Cogliati Noam Cohen