* Remove getopt and optparse deprecation notices
* Add new docs sections for command line app helper libraries
* Add guidance on choosing a CLI parsing library to the optparse docs
* Link to the new guidance from the argparse and getopt docs
* Reword intro in docs section for superseded stdlib modules
* Reframe the optparse->argparse guide as a migration guide
rather than as an upgrade guide
---------
(cherry picked from commit 831b6de6d7)
Co-authored-by: Alyssa Coghlan <ncoghlan@gmail.com>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* Use appropriate roles for ArgumentParser, Action, etc.
* Remove superfluous repeated links.
* Explicitly document signatures and add index entries for some methods
and classes.
* Make it more clear that some parameters are keyword-only.
* Fix some minor errors.
(cherry picked from commit 2ab377a47c)
gh-125296: Fix strange fragment identifier for `name or flags` in argparse docs (GH-125297)
(cherry picked from commit c1913effee)
Co-authored-by: Savannah Ostrowski <savannahostrowski@gmail.com>
Substrings of the specified string no longer considered valid values.
(cherry picked from commit f1a2417b9e)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
gh-65169: Clarify prog default in argparse (GH-31602)
(cherry picked from commit e69ff34e81)
Co-authored-by: Stanley <46876382+slateny@users.noreply.github.com>
GH-79714: Add mention of stderr for clarity to ArgumentParser.exit() (GH-123932)
(cherry picked from commit 5f5c0b9c23)
Co-authored-by: Savannah Ostrowski <savannahostrowski@gmail.com>
docs: module page titles should not start with a link to themselves (GH-117099)
(cherry picked from commit bcb435ee8f)
Co-authored-by: Ned Batchelder <ned@nedbatchelder.com>
Based on the definition of the collections.abc classes, it is more accurate to use "sequence" instead of "container" when describing argparse choices.
A previous attempt at fixing this in #92450 was mistaken; this PR reverts that change.
Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
# Fix typo in argparse docs.
> Sometimes, when dealing with **a** particularly long argument list**s**, [...]
Mixture between plural and singular forms is incorrect. Use singular consistently since typically only a single argument list is employed. Change to:
> Sometimes, when dealing with a particularly long argument list, [...]
No issue was opened, since this is a trivial change.
Automerge-Triggered-By: GH:rhettinger
Fixed few typos and enhanced few paragraphs for your review and consideration.
Trivial contribution towards continuous improvement, so no issue was raised.
Automerge-Triggered-By: GH:rhettinger
No work has been done to move this forward. On the theory that perfect is the enemy of good, I'm going to push it and we can make minor edits as needed afterwards.