mirror of
https://github.com/python/cpython.git
synced 2025-09-26 10:19:53 +00:00
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
This commit is contained in:
parent
b4912b8ed3
commit
00ccacc8db
11 changed files with 30 additions and 30 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
----------------------
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue