[issue37726] Tutorial should not recommend getopt

New submission from Guido van Rossum guido@python.org:
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:]).
---------- assignee: docs@python components: Documentation keywords: newcomer friendly messages: 348774 nosy: docs@python, gvanrossum priority: normal severity: normal stage: needs patch status: open title: Tutorial should not recommend getopt versions: Python 2.7, Python 3.7, Python 3.8, Python 3.9
_______________________________________ Python tracker report@bugs.python.org https://bugs.python.org/issue37726 _______________________________________

mental m3nta1@yahoo.com added the comment:
It's nice to see the newcomer friendly tag being encouraged :thumbsup:
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.
---------- nosy: +mental
_______________________________________ Python tracker report@bugs.python.org https://bugs.python.org/issue37726 _______________________________________

Change by mental m3nta1@yahoo.com:
---------- keywords: +patch pull_requests: +14802 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/15052
_______________________________________ Python tracker report@bugs.python.org https://bugs.python.org/issue37726 _______________________________________

Guido van Rossum guido@python.org added the comment:
New changeset 2491134029b195d3159a489e1803ee22a7839b41 by Guido van Rossum (mental) in branch 'master': bpo-37726: Prefer argparse over getopt in stdlib tutorial (#15052) https://github.com/python/cpython/commit/2491134029b195d3159a489e1803ee22a78...
----------
_______________________________________ Python tracker report@bugs.python.org https://bugs.python.org/issue37726 _______________________________________

Change by miss-islington mariatta.wijaya+miss-islington@gmail.com:
---------- pull_requests: +14816 pull_request: https://github.com/python/cpython/pull/15069
_______________________________________ Python tracker report@bugs.python.org https://bugs.python.org/issue37726 _______________________________________

Change by miss-islington mariatta.wijaya+miss-islington@gmail.com:
---------- pull_requests: +14817 pull_request: https://github.com/python/cpython/pull/15070
_______________________________________ Python tracker report@bugs.python.org https://bugs.python.org/issue37726 _______________________________________

Guido van Rossum guido@python.org added the comment:
New changeset dcc53ebbff384076b0763c1f842966c189417071 by Guido van Rossum (Miss Islington (bot)) in branch '3.8': bpo-37726: Prefer argparse over getopt in stdlib tutorial (GH-15052) (#15070) https://github.com/python/cpython/commit/dcc53ebbff384076b0763c1f842966c1894...
----------
_______________________________________ Python tracker report@bugs.python.org https://bugs.python.org/issue37726 _______________________________________

Guido van Rossum guido@python.org added the comment:
New changeset 8990ac0ab0398bfb9c62031288030fe7c630c2c7 by Guido van Rossum (Miss Islington (bot)) in branch '3.7': bpo-37726: Prefer argparse over getopt in stdlib tutorial (GH-15052) (#15069) https://github.com/python/cpython/commit/8990ac0ab0398bfb9c62031288030fe7c63...
----------
_______________________________________ Python tracker report@bugs.python.org https://bugs.python.org/issue37726 _______________________________________

Guido van Rossum guido@python.org added the comment:
Thanks mental! All done.
---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed
_______________________________________ Python tracker report@bugs.python.org https://bugs.python.org/issue37726 _______________________________________

Change by Guido van Rossum guido@python.org:
---------- versions: -Python 2.7
_______________________________________ Python tracker report@bugs.python.org https://bugs.python.org/issue37726 _______________________________________
participants (3)
-
Guido van Rossum
-
mental
-
miss-islington