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

Update the min()/max() docs for the new default argument #64819

Closed
rhettinger opened this issue Feb 13, 2014 · 7 comments
Closed

Update the min()/max() docs for the new default argument #64819

rhettinger opened this issue Feb 13, 2014 · 7 comments
Labels
docs Documentation in the Doc dir

Comments

@rhettinger
Copy link
Contributor

BPO 20620
Nosy @rhettinger, @larryhastings, @ezio-melotti, @berkerpeksag
Files
  • issue20620_v2.diff
  • issue20620_v3.diff
  • 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 = None
    closed_at = <Date 2014-05-19.21:22:15.116>
    created_at = <Date 2014-02-13.20:08:49.623>
    labels = ['docs']
    title = 'Update the min()/max() docs for the new default argument'
    updated_at = <Date 2014-05-19.22:45:15.398>
    user = 'https://github.com/rhettinger'

    bugs.python.org fields:

    activity = <Date 2014-05-19.22:45:15.398>
    actor = 'berker.peksag'
    assignee = 'docs@python'
    closed = True
    closed_date = <Date 2014-05-19.21:22:15.116>
    closer = 'rhettinger'
    components = ['Documentation']
    creation = <Date 2014-02-13.20:08:49.623>
    creator = 'rhettinger'
    dependencies = []
    files = ['34248', '35291']
    hgrepos = []
    issue_num = 20620
    keywords = ['patch']
    message_count = 7.0
    messages = ['211168', '211225', '211452', '212371', '218773', '218818', '218819']
    nosy_count = 6.0
    nosy_names = ['rhettinger', 'larry', 'ezio.melotti', 'docs@python', 'python-dev', 'berker.peksag']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue20620'
    versions = ['Python 3.4', 'Python 3.5']

    @rhettinger
    Copy link
    Contributor Author

    There is a new "default" argument for min() and max():

        >>> min([], default=10)
        10

    The new argument is not currently shown by help():

        >>> help(min)
        Help on built-in function min in module builtins:
        min(...)
            min(iterable[, key=func]) -> value
            min(a, b, c, ...[, key=func]) -> value
            
            With a single iterable argument, return its smallest item.
            With two or more arguments, return the smallest argument.

    @rhettinger rhettinger added the docs Documentation in the Doc dir label Feb 13, 2014
    @berkerpeksag
    Copy link
    Member

    Here's a patch to update the min() and max() documentations.

    @larryhastings
    Copy link
    Contributor

    key and default are keyword-only arguments, the signature should have a '*'.

    @berkerpeksag
    Copy link
    Member

    Updated patch adressing Larry's comment. I also fixed a typo in the max() documentation. Thanks!

    @berkerpeksag
    Copy link
    Member

    Rebased patch.

    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented May 19, 2014

    New changeset b60258f4499c by Raymond Hettinger in branch '3.4':
    bpo-20620: Update the min()/max() docs for the new default argument.
    http://hg.python.org/cpython/rev/b60258f4499c

    @rhettinger
    Copy link
    Contributor Author

    Thanks for the patch.

    @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

    3 participants