Skip to content

Commit 46245b0

Browse files
authored
Docs: Use substitutions instead of manual version updates (#115416)
1 parent f15795c commit 46245b0

File tree

4 files changed

+6
-4
lines changed

4 files changed

+6
-4
lines changed

Doc/conf.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,8 @@
6666

6767
rst_epilog = f"""
6868
.. |python_version_literal| replace:: ``Python {version}``
69+
.. |python_x_dot_y_literal| replace:: ``python{version}``
70+
.. |usr_local_bin_python_x_dot_y_literal| replace:: ``/usr/local/bin/python{version}``
6971
"""
7072

7173
# There are two options for replacing |today|: either, you set today to some

Doc/tutorial/interpreter.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Using the Python Interpreter
1010
Invoking the Interpreter
1111
========================
1212

13-
The Python interpreter is usually installed as :file:`/usr/local/bin/python3.13`
13+
The Python interpreter is usually installed as |usr_local_bin_python_x_dot_y_literal|
1414
on those machines where it is available; putting :file:`/usr/local/bin` in your
1515
Unix shell's search path makes it possible to start it by typing the command:
1616

@@ -24,7 +24,7 @@ Python guru or system administrator. (E.g., :file:`/usr/local/python` is a
2424
popular alternative location.)
2525

2626
On Windows machines where you have installed Python from the :ref:`Microsoft Store
27-
<windows-store>`, the :file:`python3.13` command will be available. If you have
27+
<windows-store>`, the |python_x_dot_y_literal| command will be available. If you have
2828
the :ref:`py.exe launcher <launcher>` installed, you can use the :file:`py`
2929
command. See :ref:`setting-envvars` for other ways to launch Python.
3030

Doc/tutorial/stdlib.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ operating system::
1515

1616
>>> import os
1717
>>> os.getcwd() # Return the current working directory
18-
'C:\\Python312'
18+
'C:\\Python313'
1919
>>> os.chdir('/server/accesslogs') # Change current working directory
2020
>>> os.system('mkdir today') # Run the command mkdir in the system shell
2121
0

Doc/tutorial/stdlib2.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ applications include caching objects that are expensive to create::
279279
Traceback (most recent call last):
280280
File "<stdin>", line 1, in <module>
281281
d['primary'] # entry was automatically removed
282-
File "C:/python312/lib/weakref.py", line 46, in __getitem__
282+
File "C:/python313/lib/weakref.py", line 46, in __getitem__
283283
o = self.data[key]()
284284
KeyError: 'primary'
285285

0 commit comments

Comments
 (0)