-
-
Notifications
You must be signed in to change notification settings - Fork 32.8k
gh-126180: Remove getopt and optparse deprecation notices #126227
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
Changes from 11 commits
a560986
0a568f1
55b7215
0971780
09b0237
4cdebde
693a979
50d1ee4
4e50c74
0db2c88
e474e77
43234de
93d7161
bb91b52
7cc72ad
7f51456
5d86774
c2ae293
5e2fcd9
457ee88
f67d20c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,6 +11,18 @@ | |
|
||
**Source code:** :source:`Lib/argparse.py` | ||
|
||
.. note:: | ||
|
||
While :mod:`argparse` is the recommended standard library module for | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would not recommend it for now. You can use it on your own risk. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For this PR, I'd like to stick with the status quo as far as recommendations go (that is, only taking the step back from " Taking the extra step to saying " There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Indeed. Keep the argparse recommendation. We're not going to dis-recommend the most widely used Python argument parsing library in the world (that causes churn and angst from users). Nor are we going to be adding yet another one to the stdlib in the future. argparse supports most users quite well, "warts" and all, with plenty of popular third party options for yet other behaviors beyond our stdlib options. |
||
*implementing* basic command line applications, authors of third party | ||
command line argument processing libraries may find that the | ||
lower level :mod:`optparse` module serves as a better foundation for | ||
that use case. ``optparse`` (or one of the third party libraries | ||
based on it) may also be worth considering for applications where | ||
stricter adherence to common Unix and Linux command line interface | ||
conventions around the handling of option parameter values that start | ||
with ``-`` is desired. | ||
ncoghlan marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
-------------- | ||
|
||
.. sidebar:: Tutorial | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
.. _cmdlinelibs: | ||
|
||
******************************** | ||
Command Line Interface Libraries | ||
******************************** | ||
|
||
The modules described in this chapter assist with implementing | ||
command line and terminal interfaces for applications. | ||
|
||
Here's an overview: | ||
|
||
.. toctree:: | ||
:maxdepth: 1 | ||
|
||
argparse.rst | ||
optparse.rst | ||
gpshead marked this conversation as resolved.
Show resolved
Hide resolved
|
||
getpass.rst | ||
fileinput.rst | ||
curses.rst | ||
curses.ascii.rst | ||
curses.panel.rst |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,7 +14,6 @@ in this chapter is: | |
|
||
pathlib.rst | ||
os.path.rst | ||
fileinput.rst | ||
stat.rst | ||
filecmp.rst | ||
tempfile.rst | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
:mod:`getopt` and :mod:`optparse` are no longer marked as deprecated. | ||
There are legitimate reasons to use one of these modules in preference to | ||
:mod:`argparse`, and none of these modules are at risk of being removed | ||
from the standard library. Of the three, ``argparse`` remains the | ||
recommended default choice, *unless* one of the concerns noted at the top of | ||
the ``optparse`` module documentation applies. |
Uh oh!
There was an error while loading. Please reload this page.