[Python-checkins] cpython (2.7): Add the :mod: role where it was missing.

ezio.melotti python-checkins at python.org
Thu Apr 21 15:14:21 CEST 2011


http://hg.python.org/cpython/rev/6f27baeecf4c
changeset:   69512:6f27baeecf4c
branch:      2.7
parent:      69509:0f084f150198
user:        Ezio Melotti <ezio.melotti at gmail.com>
date:        Thu Apr 21 16:12:17 2011 +0300
summary:
  Add the :mod: role where it was missing.

files:
  Doc/library/argparse.rst |  22 +++++++++++-----------
  1 files changed, 11 insertions(+), 11 deletions(-)


diff --git a/Doc/library/argparse.rst b/Doc/library/argparse.rst
--- a/Doc/library/argparse.rst
+++ b/Doc/library/argparse.rst
@@ -977,7 +977,7 @@
 required
 ^^^^^^^^
 
-In general, the argparse module assumes that flags like ``-f`` and ``--bar``
+In general, the :mod:`argparse` module assumes that flags like ``-f`` and ``--bar``
 indicate *optional* arguments, which can always be omitted at the command line.
 To make an option *required*, ``True`` can be specified for the ``required=``
 keyword argument to :meth:`add_argument`::
@@ -1587,9 +1587,9 @@
 
 .. method:: add_mutually_exclusive_group(required=False)
 
-   Create a mutually exclusive group. argparse will make sure that only one of
-   the arguments in the mutually exclusive group was present on the command
-   line::
+   Create a mutually exclusive group. :mod:`argparse` will make sure that only
+   one of the arguments in the mutually exclusive group was present on the
+   command line::
 
      >>> parser = argparse.ArgumentParser(prog='PROG')
      >>> group = parser.add_mutually_exclusive_group()
@@ -1757,14 +1757,14 @@
 Upgrading optparse code
 -----------------------
 
-Originally, the argparse module had attempted to maintain compatibility with
-optparse.  However, optparse was difficult to extend transparently, particularly
-with the changes required to support the new ``nargs=`` specifiers and better
-usage messages.  When most everything in optparse had either been copy-pasted
-over or monkey-patched, it no longer seemed practical to try to maintain the
-backwards compatibility.
+Originally, the mod:`argparse` module had attempted to maintain compatibility
+with :mod:`optparse`.  However, :mod:`optparse` was difficult to extend
+transparently, particularly with the changes required to support the new
+``nargs=`` specifiers and better usage messages.  When most everything in
+:mod:`optparse` had either been copy-pasted over or monkey-patched, it no
+longer seemed practical to try to maintain the backwards compatibility.
 
-A partial upgrade path from optparse to argparse:
+A partial upgrade path from :mod:`optparse` to :mod:`argparse`:
 
 * Replace all ``add_option()`` calls with :meth:`ArgumentParser.add_argument`
   calls.

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list