diff options
author | Martin Panter <vadmium+py@gmail.com> | 2016-04-16 04:59:38 (GMT) |
---|---|---|
committer | Martin Panter <vadmium+py@gmail.com> | 2016-04-16 04:59:38 (GMT) |
commit | 00ccacc8db8194f15d8af26b788ec36314b990d1 (patch) | |
tree | 98bf16d9eeb894fdcb464eed646d53b4d366bfe7 /Doc/library | |
parent | b4912b8ed367e540ee060fe912f841cc764fd293 (diff) | |
download | cpython-00ccacc8db8194f15d8af26b788ec36314b990d1.zip cpython-00ccacc8db8194f15d8af26b788ec36314b990d1.tar.gz cpython-00ccacc8db8194f15d8af26b788ec36314b990d1.tar.bz2 |
Issue #26638: Fix links to some CLI options and section headings
* Disable inappropriate links to Python interpreter options
* Correct link to CLI section in zipapp
* Make CLI section label in timeit less ambiguous
Diffstat (limited to 'Doc/library')
-rw-r--r-- | Doc/library/2to3.rst | 10 | ||||
-rw-r--r-- | Doc/library/timeit.rst | 6 | ||||
-rw-r--r-- | Doc/library/warnings.rst | 2 | ||||
-rw-r--r-- | Doc/library/zipapp.rst | 2 |
4 files changed, 10 insertions, 10 deletions
diff --git a/Doc/library/2to3.rst b/Doc/library/2to3.rst index 31f681d..15b72dd 100644 --- a/Doc/library/2to3.rst +++ b/Doc/library/2to3.rst @@ -56,7 +56,7 @@ Comments and exact indentation are preserved throughout the translation process. 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:: $ 2to3 -f imports -f has_key example.py @@ -78,12 +78,12 @@ but 2to3 cannot fix automatically. In this case, 2to3 will print a warning beneath the diff for a file. You should address the warning in order to have compliant 3.x code. -2to3 can also refactor doctests. To enable this mode, use the :option:`-d` +2to3 can also refactor doctests. To enable this mode, use the :option:`!-d` flag. Note that *only* doctests will be refactored. This also doesn't require the module to be valid Python. For example, doctest like examples in a reST document could also be refactored with this option. -The :option:`-v` option enables output of more information on the translation +The :option:`!-v` option enables output of more information on the translation process. Since some print statements can be parsed as function calls or statements, 2to3 @@ -102,14 +102,14 @@ when not overwriting the input files. .. versionadded:: 3.2.3 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 translation from one directory to another. 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:`!-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 diff --git a/Doc/library/timeit.rst b/Doc/library/timeit.rst index d1051f6..16baf91 100644 --- a/Doc/library/timeit.rst +++ b/Doc/library/timeit.rst @@ -14,7 +14,7 @@ -------------- This module provides a simple way to time small bits of Python code. It has both -a :ref:`command-line-interface` as well as a :ref:`callable <python-interface>` +a :ref:`timeit-command-line-interface` as well as a :ref:`callable <python-interface>` one. It avoids a number of common traps for measuring execution times. See also Tim Peters' introduction to the "Algorithms" chapter in the *Python Cookbook*, published by O'Reilly. @@ -23,7 +23,7 @@ Cookbook*, published by O'Reilly. Basic Examples -------------- -The following example shows how the :ref:`command-line-interface` +The following example shows how the :ref:`timeit-command-line-interface` can be used to compare three different expressions: .. code-block:: sh @@ -174,7 +174,7 @@ The module defines three convenience functions and a public class: where the traceback is sent; it defaults to :data:`sys.stderr`. -.. _command-line-interface: +.. _timeit-command-line-interface: Command-Line Interface ---------------------- diff --git a/Doc/library/warnings.rst b/Doc/library/warnings.rst index 8a538ad..037f11d 100644 --- a/Doc/library/warnings.rst +++ b/Doc/library/warnings.rst @@ -265,7 +265,7 @@ Updating Code For New Versions of Python 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` +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 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 diff --git a/Doc/library/zipapp.rst b/Doc/library/zipapp.rst index b4484c8..265e62d 100644 --- a/Doc/library/zipapp.rst +++ b/Doc/library/zipapp.rst @@ -23,7 +23,7 @@ Python code, which can be :ref:`executed directly by the Python interpreter Basic Example ------------- -The following example shows how the :ref:`command-line-interface` +The following example shows how the :ref:`zipapp-command-line-interface` can be used to create an executable archive from a directory containing Python code. When run, the archive will execute the ``main`` function from the module ``myapp`` in the archive. |