]> granicus.if.org Git - python/commitdiff
Issue #17462: Add a paragraph about advantages of argparse over optparse.
authorBerker Peksag <berker.peksag@gmail.com>
Fri, 26 Sep 2014 12:34:26 +0000 (15:34 +0300)
committerBerker Peksag <berker.peksag@gmail.com>
Fri, 26 Sep 2014 12:34:26 +0000 (15:34 +0300)
Patch by Anastasia Filatova.

Doc/library/argparse.rst
Misc/ACKS

index c79d93ec82e7a212f05443914fd5ee00728bbe3d..3260667647a3e239d36af694c0f07748c021149c 100644 (file)
@@ -1949,6 +1949,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
index 1cd18f42d5b8242a0fc6a2e7ed0a10377958f842..18216828288117c5a8e5a94bee774460cf39c5db 100644 (file)
--- a/Misc/ACKS
+++ b/Misc/ACKS
@@ -411,6 +411,7 @@ Florian Festi
 John Feuerstein
 Carl Feynman
 Vincent Fiack
+Anastasia Filatova
 Tomer Filiba
 Jeffrey Finkelstein
 Russell Finn