[Python-checkins] cpython (merge 3.5 -> 3.6): Issue #26638: Merge option warning fixes from 3.5 into 3.6

martin.panter python-checkins at python.org
Sun Oct 30 01:50:16 EDT 2016


https://hg.python.org/cpython/rev/a0d272fbc7de
changeset:   104812:a0d272fbc7de
branch:      3.6
parent:      104808:09a87b16d5e5
parent:      104811:57f4ba6b29bf
user:        Martin Panter <vadmium+py at gmail.com>
date:        Sun Oct 30 04:21:23 2016 +0000
summary:
  Issue #26638: Merge option warning fixes from 3.5 into 3.6

files:
  Doc/distutils/apiref.rst      |  32 +++++++-------
  Doc/distutils/builtdist.rst   |  32 +++++++-------
  Doc/distutils/configfile.rst  |   6 +-
  Doc/distutils/extending.rst   |   2 +-
  Doc/distutils/setupscript.rst |   2 +-
  Doc/distutils/sourcedist.rst  |  12 ++--
  Doc/extending/extending.rst   |   2 +-
  Doc/install/index.rst         |  50 +++++++++++-----------
  Doc/library/2to3.rst          |  28 ++++++------
  Doc/library/ctypes.rst        |   4 +-
  Doc/library/gettext.rst       |   2 +-
  Doc/library/unittest.rst      |   6 +-
  Doc/library/warnings.rst      |   6 +-
  Doc/using/cmdline.rst         |   5 +-
  Doc/whatsnew/2.0.rst          |   2 +-
  Doc/whatsnew/2.1.rst          |   2 +-
  Doc/whatsnew/2.2.rst          |  10 ++--
  Doc/whatsnew/2.3.rst          |  14 +++---
  Doc/whatsnew/2.4.rst          |   6 +-
  Doc/whatsnew/2.5.rst          |   6 +-
  Doc/whatsnew/2.6.rst          |   8 +-
  Doc/whatsnew/2.7.rst          |  30 ++++++------
  Doc/whatsnew/3.0.rst          |   2 +-
  23 files changed, 136 insertions(+), 133 deletions(-)


diff --git a/Doc/distutils/apiref.rst b/Doc/distutils/apiref.rst
--- a/Doc/distutils/apiref.rst
+++ b/Doc/distutils/apiref.rst
@@ -205,7 +205,7 @@
    |                        | to or ``None`` to define it    |                           |
    |                        | without a particular value     |                           |
    |                        | (equivalent of ``#define FOO`` |                           |
-   |                        | in source or :option:`-DFOO`   |                           |
+   |                        | in source or :option:`!-DFOO`  |                           |
    |                        | on Unix C compiler command     |                           |
    |                        | line)                          |                           |
    +------------------------+--------------------------------+---------------------------+
@@ -319,11 +319,11 @@
 
 .. function:: gen_preprocess_options(macros, include_dirs)
 
-   Generate C pre-processor options (:option:`-D`, :option:`!-U`, :option:`!-I`) as
+   Generate C pre-processor options (:option:`!-D`, :option:`!-U`, :option:`!-I`) as
    used by at least two types of compilers: the typical Unix compiler and Visual
    C++. *macros* is the usual thing, a list of 1- or 2-tuples, where ``(name,)``
    means undefine (:option:`!-U`) macro *name*, and ``(name, value)`` means define
-   (:option:`-D`) macro *name* to *value*.  *include_dirs* is just a list of
+   (:option:`!-D`) macro *name* to *value*.  *include_dirs* is just a list of
    directory names to be added to the header file search path (:option:`!-I`).
    Returns a list of command-line options suitable for either Unix compilers or
    Visual C++.
@@ -359,7 +359,7 @@
 
 .. function:: show_compilers()
 
-   Print list of available compilers (used by the :option:`--help-compiler` options
+   Print list of available compilers (used by the :option:`!--help-compiler` options
    to :command:`build`, :command:`build_ext`, :command:`build_clib`).
 
 
@@ -789,15 +789,15 @@
 This module provides the :class:`UnixCCompiler` class, a subclass of
 :class:`CCompiler` that handles the typical Unix-style command-line  C compiler:
 
-* macros defined with :option:`-Dname[=value]`
-
-* macros undefined with :option:`-Uname`
-
-* include search directories specified with :option:`-Idir`
-
-* libraries specified with :option:`-llib`
-
-* library search directories specified with :option:`-Ldir`
+* macros defined with :option:`!-Dname[=value]`
+
+* macros undefined with :option:`!-Uname`
+
+* include search directories specified with :option:`!-Idir`
+
+* libraries specified with :option:`!-llib`
+
+* library search directories specified with :option:`!-Ldir`
 
 * compile handled by :program:`cc` (or similar) executable with :option:`!-c`
   option: compiles :file:`.c` to :file:`.o`
@@ -805,7 +805,7 @@
 * link static library handled by :program:`ar` command (possibly with
   :program:`ranlib`)
 
-* link shared library handled by :program:`cc` :option:`-shared`
+* link shared library handled by :program:`cc` :option:`!-shared`
 
 
 :mod:`distutils.msvccompiler` --- Microsoft Compiler
@@ -1318,8 +1318,8 @@
 
 * options set attributes of a passed-in object
 
-* boolean options can have "negative aliases" --- eg. if :option:`--quiet` is
-  the "negative alias" of :option:`--verbose`, then :option:`--quiet` on the
+* boolean options can have "negative aliases" --- eg. if :option:`!--quiet` is
+  the "negative alias" of :option:`!--verbose`, then :option:`!--quiet` on the
   command line sets *verbose* to false.
 
 .. function:: fancy_getopt(options, negative_opt, object, args)
diff --git a/Doc/distutils/builtdist.rst b/Doc/distutils/builtdist.rst
--- a/Doc/distutils/builtdist.rst
+++ b/Doc/distutils/builtdist.rst
@@ -57,7 +57,7 @@
 Windows, is far more convenient for users even if your distribution doesn't
 include any extensions.
 
-The :command:`bdist` command has a :option:`--formats` option, similar to the
+The :command:`bdist` command has a :option:`!--formats` option, similar to the
 :command:`sdist` command, which you can use to select the types of built
 distribution to generate: for example, ::
 
@@ -123,7 +123,7 @@
    requires external :program:`rpm` utility, version 3.0.4 or better (use ``rpm
    --version`` to find out which version you have)
 
-You don't have to use the :command:`bdist` command with the :option:`--formats`
+You don't have to use the :command:`bdist` command with the :option:`!--formats`
 option; you can also use the command that directly implements the format you're
 interested in.  Some of these :command:`bdist` "sub-commands" actually generate
 several similar formats; for instance, the :command:`bdist_dumb` command
@@ -174,7 +174,7 @@
 
    python setup.py bdist_rpm
 
-or the :command:`bdist` command with the :option:`--format` option::
+or the :command:`bdist` command with the :option:`!--format` option::
 
    python setup.py bdist --formats=rpm
 
@@ -249,7 +249,7 @@
 you distribute or package many Python module distributions, you might want to
 put options that apply to all of them in your personal Distutils configuration
 file (:file:`~/.pydistutils.cfg`).  If you want to temporarily disable
-this file, you can pass the :option:`--no-user-cfg` option to :file:`setup.py`.
+this file, you can pass the :option:`!--no-user-cfg` option to :file:`setup.py`.
 
 There are three steps to building a binary RPM package, all of which are
 handled automatically by the Distutils:
@@ -267,10 +267,10 @@
 all three steps are typically bundled together.
 
 If you wish, you can separate these three steps.  You can use the
-:option:`--spec-only` option to make :command:`bdist_rpm` just create the
+:option:`!--spec-only` option to make :command:`bdist_rpm` just create the
 :file:`.spec` file and exit; in this case, the :file:`.spec` file will be
 written to the "distribution directory"---normally :file:`dist/`, but
-customizable with the :option:`--dist-dir` option.  (Normally, the :file:`.spec`
+customizable with the :option:`!--dist-dir` option.  (Normally, the :file:`.spec`
 file winds up deep in the "build tree," in a temporary directory created by
 :command:`bdist_rpm`.)
 
@@ -307,7 +307,7 @@
 
    python setup.py bdist_wininst
 
-or the :command:`bdist` command with the :option:`--formats` option::
+or the :command:`bdist` command with the :option:`!--formats` option::
 
    python setup.py bdist --formats=wininst
 
@@ -325,20 +325,20 @@
 The installer will try to compile pure modules into :term:`bytecode` after installation
 on the target system in normal and optimizing mode.  If you don't want this to
 happen for some reason, you can run the :command:`bdist_wininst` command with
-the :option:`--no-target-compile` and/or the :option:`--no-target-optimize`
+the :option:`!--no-target-compile` and/or the :option:`!--no-target-optimize`
 option.
 
 By default the installer will display the cool "Python Powered" logo when it is
 run, but you can also supply your own 152x261 bitmap which must be a Windows
-:file:`.bmp` file with the :option:`--bitmap` option.
+:file:`.bmp` file with the :option:`!--bitmap` option.
 
 The installer will also display a large title on the desktop background window
 when it is run, which is constructed from the name of your distribution and the
 version number.  This can be changed to another text by using the
-:option:`--title` option.
+:option:`!--title` option.
 
 The installer file will be written to the "distribution directory" --- normally
-:file:`dist/`, but customizable with the :option:`--dist-dir` option.
+:file:`dist/`, but customizable with the :option:`!--dist-dir` option.
 
 .. _cross-compile-windows:
 
@@ -350,7 +350,7 @@
 installed, you can use a 32bit version of Windows to create 64bit extensions
 and vice-versa.
 
-To build for an alternate platform, specify the :option:`--plat-name` option
+To build for an alternate platform, specify the :option:`!--plat-name` option
 to the build command.  Valid values are currently 'win32', 'win-amd64' and
 'win-ia64'.  For example, on a 32bit version of Windows, you could execute::
 
@@ -383,14 +383,14 @@
 ---------------------------
 
 Starting with Python 2.3, a postinstallation script can be specified with the
-:option:`--install-script` option.  The basename of the script must be
+:option:`!--install-script` option.  The basename of the script must be
 specified, and the script filename must also be listed in the scripts argument
 to the setup function.
 
 This script will be run at installation time on the target system after all the
-files have been copied, with ``argv[1]`` set to :option:`-install`, and again at
+files have been copied, with ``argv[1]`` set to :option:`!-install`, and again at
 uninstallation time before the files are removed with ``argv[1]`` set to
-:option:`-remove`.
+:option:`!-remove`.
 
 The installation script runs embedded in the windows installer, every output
 (``sys.stdout``, ``sys.stderr``) is redirected into a buffer and will be
@@ -453,7 +453,7 @@
 Vista User Access Control (UAC)
 ===============================
 
-Starting with Python 2.6, bdist_wininst supports a :option:`--user-access-control`
+Starting with Python 2.6, bdist_wininst supports a :option:`!--user-access-control`
 option.  The default is 'none' (meaning no UAC handling is done), and other
 valid values are 'auto' (meaning prompt for UAC elevation if Python was
 installed for all users) and 'force' (meaning always prompt for elevation).
diff --git a/Doc/distutils/configfile.rst b/Doc/distutils/configfile.rst
--- a/Doc/distutils/configfile.rst
+++ b/Doc/distutils/configfile.rst
@@ -66,7 +66,7 @@
      --swig-opts          list of SWIG command line options
    [...]
 
-Note that an option spelled :option:`--foo-bar` on the command-line  is spelled
+Note that an option spelled :option:`!--foo-bar` on the command-line  is spelled
 ``foo_bar`` in configuration files.
 
 .. _distutils-build-ext-inplace:
@@ -75,12 +75,12 @@
 have an extension :mod:`pkg.ext`, and you want the compiled extension file
 (:file:`ext.so` on Unix, say) to be put in the same source directory as your
 pure Python modules :mod:`pkg.mod1` and :mod:`pkg.mod2`.  You can always use the
-:option:`--inplace` option on the command-line to ensure this::
+:option:`!--inplace` option on the command-line to ensure this::
 
    python setup.py build_ext --inplace
 
 But this requires that you always specify the :command:`build_ext` command
-explicitly, and remember to provide :option:`--inplace`. An easier way is to
+explicitly, and remember to provide :option:`!--inplace`. An easier way is to
 "set and forget" this option, by encoding it in :file:`setup.cfg`, the
 configuration file for this distribution::
 
diff --git a/Doc/distutils/extending.rst b/Doc/distutils/extending.rst
--- a/Doc/distutils/extending.rst
+++ b/Doc/distutils/extending.rst
@@ -62,7 +62,7 @@
 third-party extensions to provide support for additional packaging systems, but
 the commands can be used for anything distutils commands can be used for.  A new
 configuration option, ``command_packages`` (command-line option
-:option:`--command-packages`), can be used to specify additional packages to be
+:option:`!--command-packages`), can be used to specify additional packages to be
 searched for modules implementing commands.  Like all distutils options, this
 can be specified on the command line or in a configuration file.  This option
 can only be set in the ``[global]`` section of a configuration file, or before
diff --git a/Doc/distutils/setupscript.rst b/Doc/distutils/setupscript.rst
--- a/Doc/distutils/setupscript.rst
+++ b/Doc/distutils/setupscript.rst
@@ -446,7 +446,7 @@
 The only clever feature is that if the first line of the script starts with
 ``#!`` and contains the word "python", the Distutils will adjust the first line
 to refer to the current interpreter location. By default, it is replaced with
-the current interpreter location.  The :option:`--executable` (or :option:`-e`)
+the current interpreter location.  The :option:`!--executable` (or :option:`!-e`)
 option will allow the interpreter path to be explicitly overridden.
 
 The ``scripts`` option simply is a list of files to be handled in this
diff --git a/Doc/distutils/sourcedist.rst b/Doc/distutils/sourcedist.rst
--- a/Doc/distutils/sourcedist.rst
+++ b/Doc/distutils/sourcedist.rst
@@ -14,7 +14,7 @@
 the current platform.  The default format is a gzip'ed tar file
 (:file:`.tar.gz`) on Unix, and ZIP file on Windows.
 
-You can specify as many formats as you like using the :option:`--formats`
+You can specify as many formats as you like using the :option:`!--formats`
 option, for example::
 
    python setup.py sdist --formats=gztar,zip
@@ -147,7 +147,7 @@
 :file:`examples/sample?/build`.  All of this is done *after* the standard
 include set, so you can exclude files from the standard set with explicit
 instructions in the manifest template.  (Or, you can use the
-:option:`--no-defaults` option to disable the standard set entirely.)  There are
+:option:`!--no-defaults` option to disable the standard set entirely.)  There are
 several other commands available in the manifest template mini-language; see
 section :ref:`sdist-cmd`.
 
@@ -166,8 +166,8 @@
 future reference, and then used to build the source distribution archive(s).
 
 You can disable the default set of included files with the
-:option:`--no-defaults` option, and you can disable the standard exclude set
-with :option:`--no-prune`.
+:option:`!--no-defaults` option, and you can disable the standard exclude set
+with :option:`!--no-prune`.
 
 Following the Distutils' own manifest template, let's trace how the
 :command:`sdist` command builds the list of files to include in the Distutils
@@ -225,7 +225,7 @@
   in) to create the source distribution archive(s)
 
 There are a couple of options that modify this behaviour.  First, use the
-:option:`--no-defaults` and :option:`--no-prune` to disable the standard
+:option:`!--no-defaults` and :option:`!--no-prune` to disable the standard
 "include" and "exclude" sets.
 
 Second, you might just want to (re)generate the manifest, but not create a source
@@ -233,4 +233,4 @@
 
    python setup.py sdist --manifest-only
 
-:option:`-o` is a shortcut for :option:`--manifest-only`.
+:option:`!-o` is a shortcut for :option:`!--manifest-only`.
diff --git a/Doc/extending/extending.rst b/Doc/extending/extending.rst
--- a/Doc/extending/extending.rst
+++ b/Doc/extending/extending.rst
@@ -886,7 +886,7 @@
 :func:`~gc.collect` function), as well as configuration
 interfaces and the ability to disable the detector at runtime.  The cycle
 detector is considered an optional component; though it is included by default,
-it can be disabled at build time using the :option:`--without-cycle-gc` option
+it can be disabled at build time using the :option:`!--without-cycle-gc` option
 to the :program:`configure` script on Unix platforms (including Mac OS X).  If
 the cycle detector is disabled in this way, the :mod:`gc` module will not be
 available.
diff --git a/Doc/install/index.rst b/Doc/install/index.rst
--- a/Doc/install/index.rst
+++ b/Doc/install/index.rst
@@ -201,7 +201,7 @@
 files to install into a *build directory*.  By default, this is :file:`build`
 under the distribution root; if you're excessively concerned with speed, or want
 to keep the source tree pristine, you can change the build directory with the
-:option:`--build-base` option. For example::
+:option:`!--build-base` option. For example::
 
    python setup.py build --build-base=/path/to/pybuild/foo-1.0
 
@@ -399,7 +399,7 @@
 
    python setup.py install --home=<dir>
 
-where you can supply any directory you like for the :option:`--home` option.  On
+where you can supply any directory you like for the :option:`!--home` option.  On
 Unix, lazy typists can just type a tilde (``~``); the :command:`install` command
 will expand this to your home directory::
 
@@ -410,7 +410,7 @@
 :mod:`sitecustomize` (see :mod:`site`) to call :func:`site.addsitedir` or edit
 :data:`sys.path`.
 
-The :option:`--home` option defines the installation base directory.  Files are
+The :option:`!--home` option defines the installation base directory.  Files are
 installed to the following directories under the installation base as follows:
 
 =============== ===========================================================
@@ -455,12 +455,12 @@
 
    /usr/local/bin/python setup.py install --prefix=/mnt/@server/export
 
-In either case, the :option:`--prefix` option defines the installation base, and
-the :option:`--exec-prefix` option defines the platform-specific installation
+In either case, the :option:`!--prefix` option defines the installation base, and
+the :option:`!--exec-prefix` option defines the platform-specific installation
 base, which is used for platform-specific files.  (Currently, this just means
 non-pure module distributions, but could be expanded to C libraries, binary
-executables, etc.)  If :option:`--exec-prefix` is not supplied, it defaults to
-:option:`--prefix`.  Files are installed as follows:
+executables, etc.)  If :option:`!--exec-prefix` is not supplied, it defaults to
+:option:`!--prefix`.  Files are installed as follows:
 
 ================= ==========================================================
 Type of file      Installation directory
@@ -472,13 +472,13 @@
 C headers         :file:`{prefix}/include/python{X.Y}{abiflags}/{distname}`
 ================= ==========================================================
 
-There is no requirement that :option:`--prefix` or :option:`--exec-prefix`
+There is no requirement that :option:`!--prefix` or :option:`!--exec-prefix`
 actually point to an alternate Python installation; if the directories listed
 above do not already exist, they are created at installation time.
 
 Incidentally, the real reason the prefix scheme is important is simply that a
-standard Unix installation uses the prefix scheme, but with :option:`--prefix`
-and :option:`--exec-prefix` supplied by Python itself as ``sys.prefix`` and
+standard Unix installation uses the prefix scheme, but with :option:`!--prefix`
+and :option:`!--exec-prefix` supplied by Python itself as ``sys.prefix`` and
 ``sys.exec_prefix``.  Thus, you might think you'll never use the prefix scheme,
 but every time you run ``python setup.py install`` without any other options,
 you're using it.
@@ -491,7 +491,7 @@
 in this way is compatible with the interpreter used to build them.  The best way
 to do this is to ensure that the two interpreters are the same version of Python
 (possibly different builds, or possibly copies of the same build).  (Of course,
-if your :option:`--prefix` and :option:`--exec-prefix` don't even point to an
+if your :option:`!--prefix` and :option:`!--exec-prefix` don't even point to an
 alternate Python installation, this is immaterial.)
 
 
@@ -501,7 +501,7 @@
 ---------------------------------------------------
 
 Windows has no concept of a user's home directory, and since the standard Python
-installation under Windows is simpler than under Unix, the :option:`--prefix`
+installation under Windows is simpler than under Unix, the :option:`!--prefix`
 option has traditionally been used to install additional packages in separate
 locations on Windows. ::
 
@@ -509,8 +509,8 @@
 
 to install modules to the :file:`\\Temp\\Python` directory on the current drive.
 
-The installation base is defined by the :option:`--prefix` option; the
-:option:`--exec-prefix` option is not supported under Windows, which means that
+The installation base is defined by the :option:`!--prefix` option; the
+:option:`!--exec-prefix` option is not supported under Windows, which means that
 pure Python modules and extension modules are installed into the same location.
 Files are installed as follows:
 
@@ -562,7 +562,7 @@
 For example, say you're installing a module distribution to your home directory
 under Unix---but you want scripts to go in :file:`~/scripts` rather than
 :file:`~/bin`. As you might expect, you can override this directory with the
-:option:`--install-scripts` option; in this case, it makes most sense to supply
+:option:`!--install-scripts` option; in this case, it makes most sense to supply
 a relative path, which will be interpreted relative to the installation base
 directory (your home directory, in this case)::
 
@@ -572,7 +572,7 @@
 with a prefix of :file:`/usr/local/python`, so under a standard  installation
 scripts will wind up in :file:`/usr/local/python/bin`.  If you want them in
 :file:`/usr/local/bin` instead, you would supply this absolute directory for the
-:option:`--install-scripts` option::
+:option:`!--install-scripts` option::
 
    python setup.py install --install-scripts=/usr/local/bin
 
@@ -932,10 +932,10 @@
   to be in Objective C.
 
 * *cpparg* is an argument for the C preprocessor,  and is anything starting with
-  :option:`!-I`, :option:`-D`, :option:`!-U` or :option:`-C`.
+  :option:`!-I`, :option:`!-D`, :option:`!-U` or :option:`!-C`.
 
-* *library* is anything ending in :file:`.a` or beginning with :option:`-l` or
-  :option:`-L`.
+* *library* is anything ending in :file:`.a` or beginning with :option:`!-l` or
+  :option:`!-L`.
 
 If a particular platform requires a special library on your platform, you can
 add it by editing the :file:`Setup` file and running ``python setup.py build``.
@@ -944,20 +944,20 @@
    foo foomodule.c
 
 must be linked with the math library :file:`libm.a` on your platform, simply add
-:option:`-lm` to the line::
+:option:`!-lm` to the line::
 
    foo foomodule.c -lm
 
 Arbitrary switches intended for the compiler or the linker can be supplied with
-the :option:`-Xcompiler` *arg* and :option:`-Xlinker` *arg* options::
+the :option:`!-Xcompiler` *arg* and :option:`!-Xlinker` *arg* options::
 
    foo foomodule.c -Xcompiler -o32 -Xlinker -shared -lm
 
-The next option after :option:`-Xcompiler` and :option:`-Xlinker` will be
+The next option after :option:`!-Xcompiler` and :option:`!-Xlinker` will be
 appended to the proper command line, so in the above example the compiler will
-be passed the :option:`-o32` option, and the linker will be passed
-:option:`-shared`.  If a compiler option requires an argument, you'll have to
-supply multiple :option:`-Xcompiler` options; for example, to pass ``-x c++``
+be passed the :option:`!-o32` option, and the linker will be passed
+:option:`!-shared`.  If a compiler option requires an argument, you'll have to
+supply multiple :option:`!-Xcompiler` options; for example, to pass ``-x c++``
 the :file:`Setup` file would have to contain ``-Xcompiler -x -Xcompiler c++``.
 
 Compiler flags can also be supplied through setting the :envvar:`CFLAGS`
diff --git a/Doc/library/2to3.rst b/Doc/library/2to3.rst
--- a/Doc/library/2to3.rst
+++ b/Doc/library/2to3.rst
@@ -41,8 +41,8 @@
 
 A diff against the original source file is printed.  2to3 can also write the
 needed modifications right back to the source file.  (A backup of the original
-file is made unless :option:`-n` is also given.)  Writing the changes back is
-enabled with the :option:`-w` flag:
+file is made unless :option:`!-n` is also given.)  Writing the changes back is
+enabled with the :option:`!-w` flag:
 
 .. code-block:: shell-session
 
@@ -60,7 +60,7 @@
 
 By default, 2to3 runs a set of :ref:`predefined fixers <2to3-fixers>`.  The
 :option:`!-l` flag lists all available fixers.  An explicit set of fixers to run
-can be given with :option:`-f`.  Likewise the :option:`!-x` explicitly disables a
+can be given with :option:`!-f`.  Likewise the :option:`!-x` explicitly disables a
 fixer.  The following example runs only the ``imports`` and ``has_key`` fixers:
 
 .. code-block:: shell-session
@@ -100,29 +100,29 @@
 cannot always read files containing the print function.  When 2to3 detects the
 presence of the ``from __future__ import print_function`` compiler directive, it
 modifies its internal grammar to interpret :func:`print` as a function.  This
-change can also be enabled manually with the :option:`-p` flag.  Use
-:option:`-p` to run fixers on code that already has had its print statements
+change can also be enabled manually with the :option:`!-p` flag.  Use
+:option:`!-p` to run fixers on code that already has had its print statements
 converted.
 
-The :option:`-o` or :option:`--output-dir` option allows specification of an
+The :option:`!-o` or :option:`!--output-dir` option allows specification of an
 alternate directory for processed output files to be written to.  The
-:option:`-n` flag is required when using this as backup files do not make sense
+:option:`!-n` flag is required when using this as backup files do not make sense
 when not overwriting the input files.
 
 .. versionadded:: 3.2.3
-   The :option:`-o` option was added.
+   The :option:`!-o` option was added.
 
-The :option:`!-W` or :option:`--write-unchanged-files` flag tells 2to3 to always
+The :option:`!-W` or :option:`!--write-unchanged-files` flag tells 2to3 to always
 write output files even if no changes were required to the file.  This is most
-useful with :option:`-o` so that an entire Python source tree is copied with
+useful with :option:`!-o` so that an entire Python source tree is copied with
 translation from one directory to another.
-This option implies the :option:`-w` flag as it would not make sense otherwise.
+This option implies the :option:`!-w` flag as it would not make sense otherwise.
 
 .. versionadded:: 3.2.3
    The :option:`!-W` flag was added.
 
-The :option:`--add-suffix` option specifies a string to append to all output
-filenames.  The :option:`-n` flag is required when specifying this as backups
+The :option:`!--add-suffix` option specifies a string to append to all output
+filenames.  The :option:`!-n` flag is required when specifying this as backups
 are not necessary when writing to different filenames.  Example:
 
 .. code-block:: shell-session
@@ -132,7 +132,7 @@
 Will cause a converted file named ``example.py3`` to be written.
 
 .. versionadded:: 3.2.3
-   The :option:`--add-suffix` option was added.
+   The :option:`!--add-suffix` option was added.
 
 To translate an entire project from one directory tree to another use:
 
diff --git a/Doc/library/ctypes.rst b/Doc/library/ctypes.rst
--- a/Doc/library/ctypes.rst
+++ b/Doc/library/ctypes.rst
@@ -1254,7 +1254,7 @@
 
    Try to find a library and return a pathname.  *name* is the library name without
    any prefix like *lib*, suffix like ``.so``, ``.dylib`` or version number (this
-   is the form used for the posix linker option :option:`-l`).  If no library can
+   is the form used for the posix linker option :option:`!-l`).  If no library can
    be found, returns ``None``.
 
 The exact functionality is system dependent.
@@ -1838,7 +1838,7 @@
 
    Try to find a library and return a pathname.  *name* is the library name
    without any prefix like ``lib``, suffix like ``.so``, ``.dylib`` or version
-   number (this is the form used for the posix linker option :option:`-l`).  If
+   number (this is the form used for the posix linker option :option:`!-l`).  If
    no library can be found, returns ``None``.
 
    The exact functionality is system dependent.
diff --git a/Doc/library/gettext.rst b/Doc/library/gettext.rst
--- a/Doc/library/gettext.rst
+++ b/Doc/library/gettext.rst
@@ -621,7 +621,7 @@
 However, you will need to teach your message extraction program to
 look for translatable strings marked with :func:`N_`. :program:`xgettext`,
 :program:`pygettext`, ``pybabel extract``, and :program:`xpot` all
-support this through the use of the :option:`-k` command-line switch.
+support this through the use of the :option:`!-k` command-line switch.
 The choice of :func:`N_` here is totally arbitrary; it could have just
 as easily been :func:`MarkThisStringForTranslation`.
 
diff --git a/Doc/library/unittest.rst b/Doc/library/unittest.rst
--- a/Doc/library/unittest.rst
+++ b/Doc/library/unittest.rst
@@ -1972,7 +1972,8 @@
    methods <deprecated-aliases>` are also special-cased and, when the warning
    filters are ``'default'`` or ``'always'``, they will appear only once
    per-module, in order to avoid too many warning messages.  This behavior can
-   be overridden using the :option:`-Wd` or :option:`-Wa` options and leaving
+   be overridden using Python's :option:`!-Wd` or :option:`!-Wa` options
+   (see :ref:`Warning control <using-on-warnings>`) and leaving
    *warnings* to ``None``.
 
    .. versionchanged:: 3.2
@@ -2053,7 +2054,8 @@
 
    The *warnings* argument specifies the :ref:`warning filter <warning-filter>`
    that should be used while running the tests.  If it's not specified, it will
-   remain ``None`` if a :option:`-W` option is passed to :program:`python`,
+   remain ``None`` if a :option:`!-W` option is passed to :program:`python`
+   (see :ref:`Warning control <using-on-warnings>`),
    otherwise it will be set to ``'default'``.
 
    Calling ``main`` actually returns an instance of the ``TestProgram`` class.
diff --git a/Doc/library/warnings.rst b/Doc/library/warnings.rst
--- a/Doc/library/warnings.rst
+++ b/Doc/library/warnings.rst
@@ -267,13 +267,13 @@
 Warnings that are only of interest to the developer are ignored by default. As
 such you should make sure to test your code with typically ignored warnings
 made visible. You can do this from the command-line by passing :option:`-Wd <-W>`
-to the interpreter (this is shorthand for :option:`-W default`).  This enables
+to the interpreter (this is shorthand for :option:`!-W default`).  This enables
 default handling for all warnings, including those that are ignored by default.
 To change what action is taken for encountered warnings you simply change what
-argument is passed to :option:`-W`, e.g. :option:`-W error`. See the
+argument is passed to :option:`-W`, e.g. :option:`!-W error`. See the
 :option:`-W` flag for more details on what is possible.
 
-To programmatically do the same as :option:`-Wd`, use::
+To programmatically do the same as :option:`!-Wd`, use::
 
   warnings.simplefilter('default')
 
diff --git a/Doc/using/cmdline.rst b/Doc/using/cmdline.rst
--- a/Doc/using/cmdline.rst
+++ b/Doc/using/cmdline.rst
@@ -192,7 +192,7 @@
 
    Issue a warning when comparing :class:`bytes` or :class:`bytearray` with
    :class:`str` or :class:`bytes` with :class:`int`.  Issue an error when the
-   option is given twice (:option:`-bb`).
+   option is given twice (:option:`!-bb`).
 
    .. versionchanged:: 3.5
       Affects comparisons of :class:`bytes` with :class:`int`.
@@ -308,11 +308,12 @@
 
    Print a message each time a module is initialized, showing the place
    (filename or built-in module) from which it is loaded.  When given twice
-   (:option:`-vv`), print a message for each file that is checked for when
+   (:option:`!-vv`), print a message for each file that is checked for when
    searching for a module.  Also provides information on module cleanup at exit.
    See also :envvar:`PYTHONVERBOSE`.
 
 
+.. _using-on-warnings:
 .. cmdoption:: -W arg
 
    Warning control.  Python's warning machinery by default prints warning
diff --git a/Doc/whatsnew/2.0.rst b/Doc/whatsnew/2.0.rst
--- a/Doc/whatsnew/2.0.rst
+++ b/Doc/whatsnew/2.0.rst
@@ -476,7 +476,7 @@
 program creates and destroys objects.  The detection of cycles can be disabled
 when Python is compiled, if you can't afford even a tiny speed penalty or
 suspect that the cycle collection is buggy, by specifying the
-:option:`--without-cycle-gc` switch when running the :program:`configure`
+:option:`!--without-cycle-gc` switch when running the :program:`configure`
 script.
 
 Several people tackled this problem and contributed to a solution.  An early
diff --git a/Doc/whatsnew/2.1.rst b/Doc/whatsnew/2.1.rst
--- a/Doc/whatsnew/2.1.rst
+++ b/Doc/whatsnew/2.1.rst
@@ -692,7 +692,7 @@
   faster than the system :func:`malloc` and have less memory overhead.  The
   allocator uses C's :func:`malloc` function to get large pools of memory, and
   then fulfills smaller memory requests from these pools.  It can be enabled by
-  providing the :option:`--with-pymalloc` option to the :program:`configure`
+  providing the :option:`!--with-pymalloc` option to the :program:`configure`
   script; see :file:`Objects/obmalloc.c` for the implementation details.
 
   Authors of C extension modules should test their code with the object allocator
diff --git a/Doc/whatsnew/2.2.rst b/Doc/whatsnew/2.2.rst
--- a/Doc/whatsnew/2.2.rst
+++ b/Doc/whatsnew/2.2.rst
@@ -758,7 +758,7 @@
   operators.
 
 * Python 2.2 supports some command-line arguments for testing whether code will
-  work with the changed division semantics.  Running python with :option:`-Q
+  work with the changed division semantics.  Running python with :option:`!-Q
   warn` will cause a warning to be issued whenever division is applied to two
   integers.  You can use this to find code that's affected by the change and fix
   it.  By default, Python 2.2 will simply perform classic division without a
@@ -779,8 +779,8 @@
 Python's Unicode support has been enhanced a bit in 2.2.  Unicode strings are
 usually stored as UCS-2, as 16-bit unsigned integers. Python 2.2 can also be
 compiled to use UCS-4, 32-bit unsigned integers, as its internal encoding by
-supplying :option:`--enable-unicode=ucs4` to the configure script.   (It's also
-possible to specify :option:`--disable-unicode` to completely disable Unicode
+supplying :option:`!--enable-unicode=ucs4` to the configure script.   (It's also
+possible to specify :option:`!--disable-unicode` to completely disable Unicode
 support.)
 
 When built to use UCS-4 (a "wide Python"), the interpreter can natively handle
@@ -979,7 +979,7 @@
   output have been corrected.  (Contributed by Fred L. Drake, Jr. and Tim Peters.)
 
 * The :mod:`socket` module can be compiled to support IPv6; specify the
-  :option:`--enable-ipv6` option to Python's configure script.  (Contributed by
+  :option:`!--enable-ipv6` option to Python's configure script.  (Contributed by
   Jun-ichiro "itojun" Hagino.)
 
 * Two new format characters were added to the :mod:`struct` module for 64-bit
@@ -1140,7 +1140,7 @@
   in the main Python CVS tree, and many changes have been made to support MacOS X.
 
   The most significant change is the ability to build Python as a framework,
-  enabled by supplying the :option:`--enable-framework` option to the configure
+  enabled by supplying the :option:`!--enable-framework` option to the configure
   script when compiling Python.  According to Jack Jansen, "This installs a self-
   contained Python installation plus the OS X framework "glue" into
   :file:`/Library/Frameworks/Python.framework` (or another location of choice).
diff --git a/Doc/whatsnew/2.3.rst b/Doc/whatsnew/2.3.rst
--- a/Doc/whatsnew/2.3.rst
+++ b/Doc/whatsnew/2.3.rst
@@ -394,7 +394,7 @@
 line-endings.
 
 This feature can be disabled when compiling Python by specifying the
-:option:`--without-universal-newlines` switch when running Python's
+:option:`!--without-universal-newlines` switch when running Python's
 :program:`configure` script.
 
 
@@ -1812,9 +1812,9 @@
 
 In 2.1 and 2.2, pymalloc was an experimental feature and wasn't enabled by
 default; you had to explicitly enable it when compiling Python by providing the
-:option:`--with-pymalloc` option to the :program:`configure` script.  In 2.3,
+:option:`!--with-pymalloc` option to the :program:`configure` script.  In 2.3,
 pymalloc has had further enhancements and is now enabled by default; you'll have
-to supply :option:`--without-pymalloc` to disable it.
+to supply :option:`!--without-pymalloc` to disable it.
 
 This change is transparent to code written in Python; however, pymalloc may
 expose bugs in C extensions.  Authors of C extension modules should test their
@@ -1853,7 +1853,7 @@
 features to catch memory overwrites and doubled frees in both extension modules
 and in the interpreter itself.  To enable this support, compile a debugging
 version of the Python interpreter by running :program:`configure` with
-:option:`--with-pydebug`.
+:option:`!--with-pydebug`.
 
 To aid extension writers, a header file :file:`Misc/pymemcompat.h` is
 distributed with the source to Python 2.3 that allows Python extensions to use
@@ -1879,11 +1879,11 @@
 
 * The cycle detection implementation used by the garbage collection has proven
   to be stable, so it's now been made mandatory.  You can no longer compile Python
-  without it, and the :option:`--with-cycle-gc` switch to :program:`configure` has
+  without it, and the :option:`!--with-cycle-gc` switch to :program:`configure` has
   been removed.
 
 * Python can now optionally be built as a shared library
-  (:file:`libpython2.3.so`) by supplying :option:`--enable-shared` when running
+  (:file:`libpython2.3.so`) by supplying :option:`!--enable-shared` when running
   Python's :program:`configure` script.  (Contributed by Ondrej Palkovsky.)
 
 * The :c:macro:`DL_EXPORT` and :c:macro:`DL_IMPORT` macros are now deprecated.
@@ -1892,7 +1892,7 @@
   generally use the :c:macro:`PyAPI_FUNC` and :c:macro:`PyAPI_DATA` macros.
 
 * The interpreter can be compiled without any docstrings for the built-in
-  functions and modules by supplying :option:`--without-doc-strings` to the
+  functions and modules by supplying :option:`!--without-doc-strings` to the
   :program:`configure` script. This makes the Python executable about 10% smaller,
   but will also mean that you can't get help for Python's built-ins.  (Contributed
   by Gustavo Niemeyer.)
diff --git a/Doc/whatsnew/2.4.rst b/Doc/whatsnew/2.4.rst
--- a/Doc/whatsnew/2.4.rst
+++ b/Doc/whatsnew/2.4.rst
@@ -1483,10 +1483,10 @@
 
 * Python can now be built with additional profiling for the interpreter itself,
   intended as an aid to people developing the Python core.  Providing
-  :option:`--enable-profiling` to the :program:`configure` script will let you
+  :option:`!--enable-profiling` to the :program:`configure` script will let you
   profile the interpreter with :program:`gprof`, and providing the
-  :option:`--with-tsc` switch enables profiling using the Pentium's Time-Stamp-
-  Counter register.  Note that the :option:`--with-tsc` switch is slightly
+  :option:`!--with-tsc` switch enables profiling using the Pentium's Time-Stamp-
+  Counter register.  Note that the :option:`!--with-tsc` switch is slightly
   misnamed, because the profiling feature also works on the PowerPC platform,
   though that processor architecture doesn't call that register "the TSC
   register".  (Contributed by Jeremy Hylton.)
diff --git a/Doc/whatsnew/2.5.rst b/Doc/whatsnew/2.5.rst
--- a/Doc/whatsnew/2.5.rst
+++ b/Doc/whatsnew/2.5.rst
@@ -236,7 +236,7 @@
 Before a package can be uploaded, you must be able to build a distribution using
 the :command:`sdist` Distutils command.  Once that works, you can run ``python
 setup.py upload`` to add your package to the PyPI archive.  Optionally you can
-GPG-sign the package by supplying the :option:`--sign` and :option:`--identity`
+GPG-sign the package by supplying the :option:`!--sign` and :option:`!--identity`
 options.
 
 Package uploading was implemented by Martin von Löwis and Richard Jones.
@@ -1639,7 +1639,7 @@
 
 * The :mod:`webbrowser` module received a number of enhancements. It's now
   usable as a script with ``python -m webbrowser``, taking a URL as the argument;
-  there are a number of switches  to control the behaviour (:option:`-n` for a new
+  there are a number of switches  to control the behaviour (:option:`!-n` for a new
   browser window,  :option:`!-t` for a new tab).  New module-level functions,
   :func:`open_new` and :func:`open_new_tab`, were added  to support this.  The
   module's :func:`open` function supports an additional feature, an *autoraise*
@@ -2209,7 +2209,7 @@
 * MacOS X (10.3 and higher): dynamic loading of modules now uses the
   :c:func:`dlopen` function instead of MacOS-specific functions.
 
-* MacOS X: an :option:`--enable-universalsdk` switch was added to the
+* MacOS X: an :option:`!--enable-universalsdk` switch was added to the
   :program:`configure` script that compiles the interpreter as a universal binary
   able to run on both PowerPC and Intel processors. (Contributed by Ronald
   Oussoren; :issue:`2573`.)
diff --git a/Doc/whatsnew/2.6.rst b/Doc/whatsnew/2.6.rst
--- a/Doc/whatsnew/2.6.rst
+++ b/Doc/whatsnew/2.6.rst
@@ -58,7 +58,7 @@
 remaining compatible with existing code by not removing older features
 or syntax.  When it's not possible to do that, Python 2.6 tries to do
 what it can, adding compatibility functions in a
-:mod:`future_builtins` module and a :option:`-3` switch to warn about
+:mod:`future_builtins` module and a :option:`!-3` switch to warn about
 usages that will become unsupported in 3.0.
 
 Some significant new packages have been added to the standard library,
@@ -116,7 +116,7 @@
 compatible with 3.0 can do ``from future_builtins import hex, map`` as
 necessary.
 
-A new command-line switch, :option:`-3`, enables warnings
+A new command-line switch, :option:`!-3`, enables warnings
 about features that will be removed in Python 3.0.  You can run code
 with this switch to see how much work will be necessary to port
 code to 3.0.  The value of this switch is available
@@ -2992,7 +2992,7 @@
 
 * On Mac OS X, Python 2.6 can be compiled as a 4-way universal build.
   The :program:`configure` script
-  can take a :option:`--with-universal-archs=[32-bit|64-bit|all]`
+  can take a :option:`!--with-universal-archs=[32-bit|64-bit|all]`
   switch, controlling whether the binaries are built for 32-bit
   architectures (x86, PowerPC), 64-bit (x86-64 and PPC-64), or both.
   (Contributed by Ronald Oussoren.)
@@ -3147,7 +3147,7 @@
 
 * When compiling a framework build of Python, you can now specify the
   framework name to be used by providing the
-  :option:`--with-framework-name=` option to the
+  :option:`!--with-framework-name=` option to the
   :program:`configure` script.
 
 * The :mod:`macfs` module has been removed.  This in turn required the
diff --git a/Doc/whatsnew/2.7.rst b/Doc/whatsnew/2.7.rst
--- a/Doc/whatsnew/2.7.rst
+++ b/Doc/whatsnew/2.7.rst
@@ -198,8 +198,8 @@
 
 * :func:`operator.isCallable` and :func:`operator.sequenceIncludes`,
   which are not supported in 3.x, now trigger warnings.
-* The :option:`-3` switch now automatically
-  enables the :option:`-Qwarn <-Q>` switch that causes warnings
+* The :option:`!-3` switch now automatically
+  enables the :option:`!-Qwarn` switch that causes warnings
   about using classic division with integers and long integers.
 
 
@@ -390,7 +390,7 @@
     args = parser.parse_args()
     print args.__dict__
 
-Unless you override it, :option:`-h` and :option:`--help` switches
+Unless you override it, :option:`!-h` and :option:`!--help` switches
 are automatically added, and produce neatly formatted output::
 
     -> ./python.exe argparse-example.py --help
@@ -960,7 +960,7 @@
   benchmark results on 32-bit machines have been mixed.  Therefore,
   the default is to use base 2**30 on 64-bit machines and base 2**15
   on 32-bit machines; on Unix, there's a new configure option
-  :option:`--enable-big-digits` that can be used to override this default.
+  :option:`!--enable-big-digits` that can be used to override this default.
 
   Apart from the performance improvements this change should be
   invisible to end users, with one exception: for testing and
@@ -1844,12 +1844,12 @@
 
 The :func:`~unittest.main` function supports some other new options:
 
-* :option:`-b <unittest -b>` or :option:`--buffer` will buffer the standard output
+* :option:`-b <unittest -b>` or :option:`!--buffer` will buffer the standard output
   and standard error streams during each test.  If the test passes,
   any resulting output will be discarded; on failure, the buffered
   output will be displayed.
 
-* :option:`-c <unittest -c>` or :option:`--catch` will cause the control-C interrupt
+* :option:`-c <unittest -c>` or :option:`!--catch` will cause the control-C interrupt
   to be handled more gracefully.  Instead of interrupting the test
   process immediately, the currently running test will be completed
   and then the partial results up to the interruption will be reported.
@@ -1863,7 +1863,7 @@
   :func:`~unittest.removeHandler` decorator that can be used to mark tests that
   should have the control-C handling disabled.
 
-* :option:`-f <unittest -f>` or :option:`--failfast` makes
+* :option:`-f <unittest -f>` or :option:`!--failfast` makes
   test execution stop immediately when a test fails instead of
   continuing to execute further tests.  (Suggested by Cliff Dyer and
   implemented by Michael Foord; :issue:`8074`.)
@@ -2238,19 +2238,19 @@
   with ``Py``, or with ``_ctypes``.  (Implemented by Thomas
   Heller; :issue:`3102`.)
 
-* New configure option: the :option:`--with-system-expat` switch allows
+* New configure option: the :option:`!--with-system-expat` switch allows
   building the :mod:`pyexpat` module to use the system Expat library.
   (Contributed by Arfrever Frehtes Taifersar Arahesis; :issue:`7609`.)
 
 * New configure option: the
-  :option:`--with-valgrind` option will now disable the pymalloc
+  :option:`!--with-valgrind` option will now disable the pymalloc
   allocator, which is difficult for the Valgrind memory-error detector
   to analyze correctly.
   Valgrind will therefore be better at detecting memory leaks and
   overruns. (Contributed by James Henstridge; :issue:`2422`.)
 
 * New configure option: you can now supply an empty string to
-  :option:`--with-dbmliborder=` in order to disable all of the various
+  :option:`!--with-dbmliborder=` in order to disable all of the various
   DBM modules.  (Added by Arfrever Frehtes Taifersar Arahesis;
   :issue:`6491`.)
 
@@ -2397,19 +2397,19 @@
   renamed, moved, or is accessed through different paths.  (Patch by
   Ziga Seilnacht and Jean-Paul Calderone; :issue:`1180193`.)
 
-* The :file:`regrtest.py` script now takes a :option:`--randseed=`
+* The :file:`regrtest.py` script now takes a :option:`!--randseed=`
   switch that takes an integer that will be used as the random seed
-  for the :option:`-r` option that executes tests in random order.
-  The :option:`-r` option also reports the seed that was used
+  for the :option:`!-r` option that executes tests in random order.
+  The :option:`!-r` option also reports the seed that was used
   (Added by Collin Winter.)
 
-* Another :file:`regrtest.py` switch is :option:`-j`, which
+* Another :file:`regrtest.py` switch is :option:`!-j`, which
   takes an integer specifying how many tests run in parallel. This
   allows reducing the total runtime on multi-core machines.
   This option is compatible with several other options, including the
   :option:`!-R` switch which is known to produce long runtimes.
   (Added by Antoine Pitrou, :issue:`6152`.)  This can also be used
-  with a new :option:`-F` switch that runs selected tests in a loop
+  with a new :option:`!-F` switch that runs selected tests in a loop
   until they fail.  (Added by Antoine Pitrou; :issue:`7312`.)
 
 * When executed as a script, the :file:`py_compile.py` module now
diff --git a/Doc/whatsnew/3.0.rst b/Doc/whatsnew/3.0.rst
--- a/Doc/whatsnew/3.0.rst
+++ b/Doc/whatsnew/3.0.rst
@@ -904,7 +904,7 @@
    port from Python 2.x to Python 2.(x+1).  Make sure all your tests
    pass.
 
-2. (Still using 2.6:) Turn on the :option:`-3` command line switch.
+2. (Still using 2.6:) Turn on the :option:`!-3` command line switch.
    This enables warnings about features that will be removed (or
    change) in 3.0.  Run your test suite again, and fix code that you
    get warnings about until there are no warnings left, and all your

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


More information about the Python-checkins mailing list