diff options
author | Berker Peksag <berker.peksag@gmail.com> | 2014-09-26 12:39:05 (GMT) |
---|---|---|
committer | Berker Peksag <berker.peksag@gmail.com> | 2014-09-26 12:39:05 (GMT) |
commit | 12f053215f162ab41bb66a3ee5084107641e5863 (patch) | |
tree | ae89c75bc0f0373cc862891aa112abb681fc9b82 | |
parent | d1a4f99159601c3555362b1caa0c17c5d135d3ec (diff) | |
download | cpython-12f053215f162ab41bb66a3ee5084107641e5863.zip cpython-12f053215f162ab41bb66a3ee5084107641e5863.tar.gz cpython-12f053215f162ab41bb66a3ee5084107641e5863.tar.bz2 |
Issue #17462: Add a paragraph about advantages of argparse over optparse.
Patch by Anastasia Filatova.
-rw-r--r-- | Doc/library/argparse.rst | 10 | ||||
-rw-r--r-- | Misc/ACKS | 1 |
2 files changed, 11 insertions, 0 deletions
diff --git a/Doc/library/argparse.rst b/Doc/library/argparse.rst index 409d688..25005ee 100644 --- a/Doc/library/argparse.rst +++ b/Doc/library/argparse.rst @@ -1913,6 +1913,16 @@ transparently, particularly with the changes required to support the new :mod:`optparse` had either been copy-pasted over or monkey-patched, it no longer seemed practical to try to maintain the backwards compatibility. +The :mod:`argparse` module improves on the standard library :mod:`optparse` +module in a number of ways including: + +* Handling positional arguments. +* Supporting sub-commands. +* Allowing alternative option prefixes like ``+`` and ``/``. +* Handling zero-or-more and one-or-more style arguments. +* Producing more informative usage messages. +* Providing a much simpler interface for custom ``type`` and ``action``. + A partial upgrade path from :mod:`optparse` to :mod:`argparse`: * Replace all :meth:`optparse.OptionParser.add_option` calls with @@ -406,6 +406,7 @@ Florian Festi John Feuerstein Carl Feynman Vincent Fiack +Anastasia Filatova Tomer Filiba Jeffrey Finkelstein Russell Finn |