From: Raymond Hettinger Date: Wed, 13 May 2015 09:47:57 +0000 (-0700) Subject: Issue #19934: Document *None* as an acceptable input to Counter.most_common([n]) X-Git-Tag: v3.5.0b1~159^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=a3780259e4ca668109a86054696002bc1b2700ce;p=thirdparty%2FPython%2Fcpython.git Issue #19934: Document *None* as an acceptable input to Counter.most_common([n]) --- diff --git a/Doc/library/collections.rst b/Doc/library/collections.rst index 0acde1292a30..be154773bdd4 100644 --- a/Doc/library/collections.rst +++ b/Doc/library/collections.rst @@ -268,9 +268,9 @@ For example:: .. method:: most_common([n]) Return a list of the *n* most common elements and their counts from the - most common to the least. If *n* is not specified, :func:`most_common` - returns *all* elements in the counter. Elements with equal counts are - ordered arbitrarily: + most common to the least. If *n* is omitted or ``None``, + :func:`most_common` returns *all* elements in the counter. Elements + with equal counts are ordered arbitrarily: >>> Counter('abracadabra').most_common(3) [('a', 5), ('r', 2), ('b', 2)]