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

Tutorial should not recommend getopt #81907

Closed
gvanrossum opened this issue Jul 31, 2019 · 6 comments
Closed

Tutorial should not recommend getopt #81907

gvanrossum opened this issue Jul 31, 2019 · 6 comments
Labels
3.7 (EOL) end of life 3.8 only security fixes 3.9 only security fixes docs Documentation in the Doc dir easy

Comments

@gvanrossum
Copy link
Member

BPO 37726
Nosy @gvanrossum, @mental32
PRs
  • bpo-37726: prefer argparse over getopt #15052
  • [3.7] bpo-37726: Prefer argparse over getopt in stdlib tutorial (GH-15052) #15069
  • [3.8] bpo-37726: Prefer argparse over getopt in stdlib tutorial (GH-15052) #15070
  • 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 2019-08-01.14:36:25.395>
    created_at = <Date 2019-07-31.04:18:10.871>
    labels = ['easy', '3.7', '3.8', '3.9', 'docs']
    title = 'Tutorial should not recommend getopt'
    updated_at = <Date 2019-08-01.14:36:53.684>
    user = 'https://github.com/gvanrossum'

    bugs.python.org fields:

    activity = <Date 2019-08-01.14:36:53.684>
    actor = 'gvanrossum'
    assignee = 'docs@python'
    closed = True
    closed_date = <Date 2019-08-01.14:36:25.395>
    closer = 'gvanrossum'
    components = ['Documentation']
    creation = <Date 2019-07-31.04:18:10.871>
    creator = 'gvanrossum'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 37726
    keywords = ['patch', 'newcomer friendly']
    message_count = 6.0
    messages = ['348774', '348797', '348856', '348857', '348858', '348859']
    nosy_count = 3.0
    nosy_names = ['gvanrossum', 'docs@python', 'mental']
    pr_nums = ['15052', '15069', '15070']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue37726'
    versions = ['Python 3.7', 'Python 3.8', 'Python 3.9']

    @gvanrossum
    Copy link
    Member Author

    I read on python-ideas that the tutorial recommends getopt as the simple argument parsing choice, and argparse as advanced. This is silly. We should only promote argparse (unless you want to use raw sys.argv[1:]).

    @gvanrossum gvanrossum added 3.7 (EOL) end of life 3.8 only security fixes 3.9 only security fixes labels Jul 31, 2019
    @gvanrossum gvanrossum added docs Documentation in the Doc dir easy labels Jul 31, 2019
    @mental32
    Copy link
    Mannequin

    mental32 mannequin commented Jul 31, 2019

    It's nice to see the newcomer friendly tag being encouraged 👍

    I'm submitting a PR for a doc change (I'd appreciate a review :D).

    I've replaced any mention of getopt in the tutorial section with the argparse module. Additionally I have added several small examples of usage promoting its usability.

    Should the section recommend using other dedicated packages for parsing: fire, click, docopt? urllib.request does this for the requests package.

    @gvanrossum
    Copy link
    Member Author

    New changeset 2491134 by Guido van Rossum (mental) in branch 'master':
    bpo-37726: Prefer argparse over getopt in stdlib tutorial (bpo-15052)
    2491134

    @gvanrossum
    Copy link
    Member Author

    New changeset dcc53eb by Guido van Rossum (Miss Islington (bot)) in branch '3.8':
    bpo-37726: Prefer argparse over getopt in stdlib tutorial (GH-15052) (bpo-15070)
    dcc53eb

    @gvanrossum
    Copy link
    Member Author

    New changeset 8990ac0 by Guido van Rossum (Miss Islington (bot)) in branch '3.7':
    bpo-37726: Prefer argparse over getopt in stdlib tutorial (GH-15052) (bpo-15069)
    8990ac0

    @gvanrossum
    Copy link
    Member Author

    Thanks mental! All done.

    @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
    3.7 (EOL) end of life 3.8 only security fixes 3.9 only security fixes docs Documentation in the Doc dir easy
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant