From bd6b3ff05c8a77d0878c888d0df40a51f37bfe96 Mon Sep 17 00:00:00 2001 From: furkanonder Date: Thu, 12 Jan 2023 12:48:24 +0300 Subject: [PATCH] Prefer "python" over "python3" --- Doc/c-api/init_config.rst | 2 +- Doc/library/__main__.rst | 2 +- Doc/library/importlib.metadata.rst | 2 +- Doc/library/pdb.rst | 4 ++-- Doc/library/stdtypes.rst | 2 +- Doc/tutorial/venv.rst | 2 +- Doc/using/cmdline.rst | 2 +- Doc/whatsnew/3.10.rst | 4 ++-- Doc/whatsnew/3.6.rst | 2 +- Doc/whatsnew/3.9.rst | 2 +- 10 files changed, 12 insertions(+), 12 deletions(-) diff --git a/Doc/c-api/init_config.rst b/Doc/c-api/init_config.rst index c3346b0421ddef..49ab6bc6a1611c 100644 --- a/Doc/c-api/init_config.rst +++ b/Doc/c-api/init_config.rst @@ -1082,7 +1082,7 @@ PyConfig without :option:`-c` or :option:`-m`. It is used by the :c:func:`Py_RunMain` function. - For example, it is set to ``script.py`` by the ``python3 script.py arg`` + For example, it is set to ``script.py`` by the ``python script.py arg`` command line. See also the :c:member:`PyConfig.skip_source_first_line` option. diff --git a/Doc/library/__main__.rst b/Doc/library/__main__.rst index 6a2a7a7317f711..761c88710f9891 100644 --- a/Doc/library/__main__.rst +++ b/Doc/library/__main__.rst @@ -259,7 +259,7 @@ one mentioned below are preferred. See :mod:`venv` for an example of a package with a minimal ``__main__.py`` in the standard library. It doesn't contain a ``if __name__ == '__main__'`` - block. You can invoke it with ``python3 -m venv [directory]``. + block. You can invoke it with ``python -m venv [directory]``. See :mod:`runpy` for more details on the :option:`-m` flag to the interpreter executable. diff --git a/Doc/library/importlib.metadata.rst b/Doc/library/importlib.metadata.rst index 988d1a317f5960..6e084101995e25 100644 --- a/Doc/library/importlib.metadata.rst +++ b/Doc/library/importlib.metadata.rst @@ -73,7 +73,7 @@ something into it: .. code-block:: shell-session - $ python3 -m venv example + $ python -m venv example $ source example/bin/activate (example) $ python -m pip install wheel diff --git a/Doc/library/pdb.rst b/Doc/library/pdb.rst index 383c3adcf289d5..d13f7965873012 100644 --- a/Doc/library/pdb.rst +++ b/Doc/library/pdb.rst @@ -49,7 +49,7 @@ of the debugger is:: :file:`pdb.py` can also be invoked as a script to debug other scripts. For example:: - python3 -m pdb myscript.py + python -m pdb myscript.py When invoked as a script, pdb will automatically enter post-mortem debugging if the program being debugged exits abnormally. After post-mortem debugging (or @@ -63,7 +63,7 @@ useful than quitting the debugger upon program's exit. .. versionadded:: 3.7 :file:`pdb.py` now accepts a ``-m`` option that execute modules similar to the way - ``python3 -m`` does. As with a script, the debugger will pause execution just + ``python -m`` does. As with a script, the debugger will pause execution just before the first line of the module. diff --git a/Doc/library/stdtypes.rst b/Doc/library/stdtypes.rst index 0ef03035a572e5..412b2f85826fe6 100644 --- a/Doc/library/stdtypes.rst +++ b/Doc/library/stdtypes.rst @@ -5579,7 +5579,7 @@ command line flag to configure the limit: ``PYTHONINTMAXSTRDIGITS=640 python3`` to set the limit to 640 or ``PYTHONINTMAXSTRDIGITS=0 python3`` to disable the limitation. * :option:`-X int_max_str_digits <-X>`, e.g. - ``python3 -X int_max_str_digits=640`` + ``python -X int_max_str_digits=640`` * :data:`sys.flags.int_max_str_digits` contains the value of :envvar:`PYTHONINTMAXSTRDIGITS` or :option:`-X int_max_str_digits <-X>`. If both the env var and the ``-X`` option are set, the ``-X`` option takes diff --git a/Doc/tutorial/venv.rst b/Doc/tutorial/venv.rst index 1fdb370b33d5af..342746532330bc 100644 --- a/Doc/tutorial/venv.rst +++ b/Doc/tutorial/venv.rst @@ -44,7 +44,7 @@ whichever version you want. To create a virtual environment, decide upon a directory where you want to place it, and run the :mod:`venv` module as a script with the directory path:: - python3 -m venv tutorial-env + python -m venv tutorial-env This will create the ``tutorial-env`` directory if it doesn't exist, and also create directories inside it containing a copy of the Python diff --git a/Doc/using/cmdline.rst b/Doc/using/cmdline.rst index 2a4d070ec057df..1074599c6f3788 100644 --- a/Doc/using/cmdline.rst +++ b/Doc/using/cmdline.rst @@ -511,7 +511,7 @@ Miscellaneous options * ``-X importtime`` to show how long each import takes. It shows module name, cumulative time (including nested imports) and self time (excluding nested imports). Note that its output may be broken in multi-threaded - application. Typical usage is ``python3 -X importtime -c 'import + application. Typical usage is ``python -X importtime -c 'import asyncio'``. See also :envvar:`PYTHONPROFILEIMPORTTIME`. * ``-X dev``: enable :ref:`Python Development Mode `, introducing additional runtime checks that are too expensive to be enabled by diff --git a/Doc/whatsnew/3.10.rst b/Doc/whatsnew/3.10.rst index 8296fb040d6758..ff99cc5fe8cc8d 100644 --- a/Doc/whatsnew/3.10.rst +++ b/Doc/whatsnew/3.10.rst @@ -1539,8 +1539,8 @@ Optimizations (Contributed by Serhiy Storchaka in :issue:`41334`.) * The :mod:`runpy` module now imports fewer modules. - The ``python3 -m module-name`` command startup time is 1.4x faster in - average. On Linux, ``python3 -I -m module-name`` imports 69 modules on Python + The ``python -m module-name`` command startup time is 1.4x faster in + average. On Linux, ``python -I -m module-name`` imports 69 modules on Python 3.9, whereas it only imports 51 modules (-18) on Python 3.10. (Contributed by Victor Stinner in :issue:`41006` and :issue:`41718`.) diff --git a/Doc/whatsnew/3.6.rst b/Doc/whatsnew/3.6.rst index e4294c88b58572..4bffd07cb54e77 100644 --- a/Doc/whatsnew/3.6.rst +++ b/Doc/whatsnew/3.6.rst @@ -2057,7 +2057,7 @@ should use :mod:`tkinter.ttk` instead. venv ~~~~ -The ``pyvenv`` script has been deprecated in favour of ``python3 -m venv``. +The ``pyvenv`` script has been deprecated in favour of ``python -m venv``. This prevents confusion as to what Python interpreter ``pyvenv`` is connected to and thus what Python interpreter will be used by the virtual environment. (Contributed by Brett Cannon in :issue:`25154`.) diff --git a/Doc/whatsnew/3.9.rst b/Doc/whatsnew/3.9.rst index e974ee3a3f73ed..4133bf8f3c09bd 100644 --- a/Doc/whatsnew/3.9.rst +++ b/Doc/whatsnew/3.9.rst @@ -222,7 +222,7 @@ Other Language Changes (Contributed by Ngalim Siregar in :issue:`37444`.) * Python now gets the absolute path of the script filename specified on - the command line (ex: ``python3 script.py``): the ``__file__`` attribute of + the command line (ex: ``python script.py``): the ``__file__`` attribute of the :mod:`__main__` module became an absolute path, rather than a relative path. These paths now remain valid after the current directory is changed by :func:`os.chdir`. As a side effect, the traceback also displays the