]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Docs: Use substitutions instead of manual version updates (#115416)
authorHugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Wed, 14 Feb 2024 06:55:00 +0000 (08:55 +0200)
committerGitHub <noreply@github.com>
Wed, 14 Feb 2024 06:55:00 +0000 (23:55 -0700)
Doc/conf.py
Doc/tutorial/interpreter.rst
Doc/tutorial/stdlib.rst
Doc/tutorial/stdlib2.rst

index 677d139046e5d07cf8b5b46af63944a6bb1f3ea3..0e84d866a22f5b177942be6e411d1b8ac5dddfc0 100644 (file)
@@ -66,6 +66,8 @@ version, release = patchlevel.get_version_info()
 
 rst_epilog = f"""
 .. |python_version_literal| replace:: ``Python {version}``
+.. |python_x_dot_y_literal| replace:: ``python{version}``
+.. |usr_local_bin_python_x_dot_y_literal| replace:: ``/usr/local/bin/python{version}``
 """
 
 # There are two options for replacing |today|: either, you set today to some
index 42ebf2b3d294a8bf49fc2a65d556e0a9d708cee2..299b6c2777adc0e33cca0eab06365a43d5b3eedd 100644 (file)
@@ -10,7 +10,7 @@ Using the Python Interpreter
 Invoking the Interpreter
 ========================
 
-The Python interpreter is usually installed as :file:`/usr/local/bin/python3.13`
+The Python interpreter is usually installed as |usr_local_bin_python_x_dot_y_literal|
 on those machines where it is available; putting :file:`/usr/local/bin` in your
 Unix shell's search path makes it possible to start it by typing the command:
 
@@ -24,7 +24,7 @@ Python guru or system administrator.  (E.g., :file:`/usr/local/python` is a
 popular alternative location.)
 
 On Windows machines where you have installed Python from the :ref:`Microsoft Store
-<windows-store>`, the :file:`python3.13` command will be available. If you have
+<windows-store>`, the |python_x_dot_y_literal| command will be available. If you have
 the :ref:`py.exe launcher <launcher>` installed, you can use the :file:`py`
 command. See :ref:`setting-envvars` for other ways to launch Python.
 
index 63f4b5e1ce0207345b5a631757d5897bf6c87345..9def2a5714950bc66f10de710041d22ef7bf13c9 100644 (file)
@@ -15,7 +15,7 @@ operating system::
 
    >>> import os
    >>> os.getcwd()      # Return the current working directory
-   'C:\\Python312'
+   'C:\\Python313'
    >>> os.chdir('/server/accesslogs')   # Change current working directory
    >>> os.system('mkdir today')   # Run the command mkdir in the system shell
    0
index 33f311db3a24d23b312805a87e17e8a28217b4f4..09b6f3d91bcfed7df287e58fd8e2691a5dea8133 100644 (file)
@@ -279,7 +279,7 @@ applications include caching objects that are expensive to create::
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
        d['primary']                # entry was automatically removed
-     File "C:/python312/lib/weakref.py", line 46, in __getitem__
+     File "C:/python313/lib/weakref.py", line 46, in __getitem__
        o = self.data[key]()
    KeyError: 'primary'