[Python-checkins] cpython (2.7): Issue #12602: Add missing cross-references to runpy and using/cmdline docs.

berker.peksag python-checkins at python.org
Wed Dec 10 01:07:00 CET 2014


https://hg.python.org/cpython/rev/078dbecf2e2c
changeset: 93797:078dbecf2e2c
branch: 2.7
parent: 93780:ce72e3c45884
user: Berker Peksag <berker.peksag at gmail.com>
date: Wed Dec 10 02:07:08 2014 +0200
summary:
 Issue #12602: Add missing cross-references to runpy and using/cmdline docs.
Patch by Éric Araujo.
files:
 Doc/library/runpy.rst | 11 +++++++++--
 Doc/tutorial/interpreter.rst | 2 ++
 Doc/using/cmdline.rst | 8 ++++++--
 3 files changed, 17 insertions(+), 4 deletions(-)
diff --git a/Doc/library/runpy.rst b/Doc/library/runpy.rst
--- a/Doc/library/runpy.rst
+++ b/Doc/library/runpy.rst
@@ -72,6 +72,9 @@
 arguments. It is recommended that the :mod:`sys` module be left alone when
 invoking this function from threaded code.
 
+ .. seealso::
+ The :option:`-m` option offering equivalent functionality from the
+ command line.
 
 .. versionchanged:: 2.7
 Added ability to execute packages by looking for a ``__main__``
@@ -134,14 +137,18 @@
 limitations still apply, use of this function in threaded code should be
 either serialised with the import lock or delegated to a separate process.
 
+ .. seealso::
+ :ref:`using-on-interface-options` for equivalent functionality on the
+ command line (``python path/to/script``).
+
 .. versionadded:: 2.7
 
 .. seealso::
 
- :pep:`338` - Executing modules as scripts
+ :pep:`338` -- Executing modules as scripts
 PEP written and implemented by Nick Coghlan.
 
- :pep:`366` - Main module explicit relative imports
+ :pep:`366` -- Main module explicit relative imports
 PEP written and implemented by Nick Coghlan.
 
 :ref:`using-on-general` - CPython command line details
diff --git a/Doc/tutorial/interpreter.rst b/Doc/tutorial/interpreter.rst
--- a/Doc/tutorial/interpreter.rst
+++ b/Doc/tutorial/interpreter.rst
@@ -62,6 +62,8 @@
 and enter interactive mode afterwards. This can be done by passing :option:`-i`
 before the script.
 
+All command-line options are described in :ref:`using-on-general`.
+
 
 .. _tut-argpassing:
 
diff --git a/Doc/using/cmdline.rst b/Doc/using/cmdline.rst
--- a/Doc/using/cmdline.rst
+++ b/Doc/using/cmdline.rst
@@ -1,7 +1,7 @@
-.. highlightlang:: none
+.. highlightlang:: sh
 
 .. ATTENTION: You probably should update Misc/python.man, too, if you modify
-.. this file.
+ this file.
 
 .. _using-on-general:
 
@@ -130,6 +130,10 @@
 ``"-"`` and the current directory will be added to the start of
 :data:`sys.path`.
 
+ .. seealso::
+ :func:`runpy.run_path`
+ Equivalent functionality directly available to Python code
+
 
 .. describe:: <script>
 
-- 
Repository URL: https://hg.python.org/cpython


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /