Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

collections.Counter.most_common does not document None as acceptable input. #64133

Closed
mgilson mannequin opened this issue Dec 9, 2013 · 6 comments
Closed

collections.Counter.most_common does not document None as acceptable input. #64133

mgilson mannequin opened this issue Dec 9, 2013 · 6 comments
Assignees
Labels
docs Documentation in the Doc dir

Comments

@mgilson
Copy link
Mannequin

mgilson mannequin commented Dec 9, 2013

BPO 19934
Nosy @rhettinger
Files
  • mywork.patch
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = 'https://github.com/rhettinger'
    closed_at = <Date 2015-05-13.09:51:37.991>
    created_at = <Date 2013-12-09.04:54:38.399>
    labels = ['docs']
    title = 'collections.Counter.most_common does not document `None` as acceptable input.'
    updated_at = <Date 2015-05-13.15:25:51.402>
    user = 'https://bugs.python.org/mgilson'

    bugs.python.org fields:

    activity = <Date 2015-05-13.15:25:51.402>
    actor = 'python-dev'
    assignee = 'rhettinger'
    closed = True
    closed_date = <Date 2015-05-13.09:51:37.991>
    closer = 'rhettinger'
    components = ['Documentation']
    creation = <Date 2013-12-09.04:54:38.399>
    creator = 'mgilson'
    dependencies = []
    files = ['33050']
    hgrepos = []
    issue_num = 19934
    keywords = ['patch']
    message_count = 6.0
    messages = ['205648', '205649', '243065', '243066', '243067', '243097']
    nosy_count = 4.0
    nosy_names = ['rhettinger', 'docs@python', 'python-dev', 'mgilson']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = None
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue19934'
    versions = []

    @mgilson
    Copy link
    Mannequin Author

    mgilson mannequin commented Dec 9, 2013

    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.

    @mgilson mgilson mannequin assigned docspython Dec 9, 2013
    @mgilson mgilson mannequin added the docs Documentation in the Doc dir label Dec 9, 2013
    @mgilson
    Copy link
    Mannequin Author

    mgilson mannequin commented Dec 9, 2013

    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.

    @rhettinger rhettinger assigned rhettinger and unassigned docspython Dec 11, 2013
    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented May 13, 2015

    New changeset 8440dda28ffe by Raymond Hettinger in branch '3.4':
    Issue bpo-19934: Document *None* as an acceptable input to Counter.most_common([n])
    https://hg.python.org/cpython/rev/8440dda28ffe

    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented May 13, 2015

    New changeset df708898f27b by Raymond Hettinger in branch '2.7':
    Issue bpo-19934: Document *None* as an acceptable input to Counter.most_common([n])
    https://hg.python.org/cpython/rev/df708898f27b

    @rhettinger
    Copy link
    Contributor

    Thanks for pointing out the omission.

    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented May 13, 2015

    New changeset 68d653f9a2c9 by Andrew Kuchling in branch '2.7':
    bpo-19934: fix mangled wording
    https://hg.python.org/cpython/rev/68d653f9a2c9

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    docs Documentation in the Doc dir
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant