This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: collections.Counter.most_common does not document `None` as acceptable input.
Type: Stage:
Components: Documentation Versions:
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: rhettinger Nosy List: docs@python, mgilson, python-dev, rhettinger
Priority: normal Keywords: patch

Created on 2013-12-09 04:54 by mgilson, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
mywork.patch mgilson, 2013-12-09 04:59 review
Messages (6)
msg205648 - (view) Author: Matthew Gilson (mgilson) * Date: 2013-12-09 04:54
Reading the source for collections.Counter.most_common, the docstring mentions that `n` can be `None` or omitted, but the online documentation does not mention that `n` can be `None`.
msg205649 - (view) Author: Matthew Gilson (mgilson) * Date: 2013-12-09 04:59
This is a very simple patch which addresses the issue.  I am still curious whether the reported function signature should be changed from:

    .. method:: most_common([n])

to:

    .. method:: most_common(n=None)

.  Any thoughts?

Also, while I was in there, I changed a few *None* to ``None`` for consistency with the rest of the documentation.
msg243065 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2015-05-13 09:48
New changeset 8440dda28ffe by Raymond Hettinger in branch '3.4':
Issue #19934:  Document *None* as an acceptable input to Counter.most_common([n])
https://hg.python.org/cpython/rev/8440dda28ffe
msg243066 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2015-05-13 09:51
New changeset df708898f27b by Raymond Hettinger in branch '2.7':
Issue #19934:  Document *None* as an acceptable input to Counter.most_common([n])
https://hg.python.org/cpython/rev/df708898f27b
msg243067 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2015-05-13 09:51
Thanks for pointing out the omission.
msg243097 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2015-05-13 15:25
New changeset 68d653f9a2c9 by Andrew Kuchling in branch '2.7':
#19934: fix mangled wording
https://hg.python.org/cpython/rev/68d653f9a2c9
History
Date User Action Args
2022-04-11 14:57:55adminsetgithub: 64133
2015-05-13 15:25:51python-devsetmessages: + msg243097
2015-05-13 09:51:37rhettingersetstatus: open -> closed
resolution: fixed
messages: + msg243067
2015-05-13 09:51:07python-devsetmessages: + msg243066
2015-05-13 09:48:30python-devsetnosy: + python-dev
messages: + msg243065
2013-12-11 21:48:04rhettingersetassignee: docs@python -> rhettinger
2013-12-09 07:02:16vajraskysetnosy: + rhettinger
2013-12-09 04:59:56mgilsonsetfiles: + mywork.patch
keywords: + patch
messages: + msg205649
2013-12-09 04:54:38mgilsoncreate