-
-
Notifications
You must be signed in to change notification settings - Fork 34.6k
Undeprecate getopt and optparse #126180
Copy link
Copy link
Closed
Labels
docsDocumentation in the Doc dirDocumentation in the Doc dirtype-featureA feature request or enhancementA feature request or enhancement
Metadata
Metadata
Assignees
Labels
docsDocumentation in the Doc dirDocumentation in the Doc dirtype-featureA feature request or enhancementA feature request or enhancement
Projects
Status
Todo
See discussion at https://discuss.python.org/t/getopt-and-optparse-vs-argparse/69618. Seems that all support this.
argparsehas many issues, some are fundamental and cannot be easily worked around. Its implements behavior different from the behavior of other Unix/Linux programs in subtle ways. It is still not mature to be the preferable Python module for CLI.getoptis a de-facto cross-language standard. Many programmers that came from other programming languges are already familiar with it. It is very simple, so even if there are other CLI modules, it should be left in the stdlib.optparseprovides an object-oriented interface. Even if it has less features thanargparse, it is more stable and has less bugs. It should be the preferable Python module for CLI.Linked PRs