classification
Title: Tutorial should not recommend getopt
Type: Stage: resolved
Components: Documentation Versions: Python 3.9, Python 3.8, Python 3.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: docs@python Nosy List: docs@python, gvanrossum, mental
Priority: normal Keywords: newcomer friendly, patch

Created on 2019-07-31 04:18 by gvanrossum, last changed 2019-08-01 14:36 by gvanrossum. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 15052 merged mental, 2019-07-31 11:09
PR 15069 merged miss-islington, 2019-08-01 14:19
PR 15070 merged miss-islington, 2019-08-01 14:19
Messages (6)
msg348774 - (view) Author: Guido van Rossum (gvanrossum) * (Python committer) Date: 2019-07-31 04:18
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:]).
msg348797 - (view) Author: (mental) * Date: 2019-07-31 11:09
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.
msg348856 - (view) Author: Guido van Rossum (gvanrossum) * (Python committer) Date: 2019-08-01 14:17
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/2491134029b195d3159a489e1803ee22a7839b41
msg348857 - (view) Author: Guido van Rossum (gvanrossum) * (Python committer) Date: 2019-08-01 14:35
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/dcc53ebbff384076b0763c1f842966c189417071
msg348858 - (view) Author: Guido van Rossum (gvanrossum) * (Python committer) Date: 2019-08-01 14:35
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/8990ac0ab0398bfb9c62031288030fe7c630c2c7
msg348859 - (view) Author: Guido van Rossum (gvanrossum) * (Python committer) Date: 2019-08-01 14:36
Thanks mental! All done.
History
Date User Action Args
2019-08-01 14:36:53gvanrossumsetversions: - Python 2.7
2019-08-01 14:36:25gvanrossumsetstatus: open -> closed
resolution: fixed
messages: + msg348859

stage: patch review -> resolved
2019-08-01 14:35:23gvanrossumsetmessages: + msg348858
2019-08-01 14:35:04gvanrossumsetmessages: + msg348857
2019-08-01 14:19:15miss-islingtonsetpull_requests: + pull_request14817
2019-08-01 14:19:06miss-islingtonsetpull_requests: + pull_request14816
2019-08-01 14:17:57gvanrossumsetmessages: + msg348856
2019-07-31 11:09:40mentalsetkeywords: + patch
stage: needs patch -> patch review
pull_requests: + pull_request14802
2019-07-31 11:09:29mentalsetnosy: + mental
messages: + msg348797
2019-07-31 04:18:10gvanrossumcreate