https://github.com/python/cpython/commit/931cfdf8edcd867e3fe1f20fc001f917e3f8890e
commit: 931cfdf8edcd867e3fe1f20fc001f917e3f8890e
branch: main
author: Matt Van Horn <[email protected]>
committer: pablogsal <[email protected]>
date: 2026-07-11T16:57:37+01:00
summary:

gh-145694: Update tutorial indentation guidance for PyREPL auto-indent (#145725)

The tutorial stated users must manually type tabs/spaces at the interactive
prompt, which is no longer accurate since the PyREPL in Python 3.13+
auto-indents after compound statement headers. Updated to mention both
the default REPL behavior and the basic REPL fallback.

files:
M Doc/tutorial/introduction.rst

diff --git a/Doc/tutorial/introduction.rst b/Doc/tutorial/introduction.rst
index 7778e37a9adaa95..465c32d0b72431c 100644
--- a/Doc/tutorial/introduction.rst
+++ b/Doc/tutorial/introduction.rst
@@ -532,10 +532,13 @@ This example introduces several new features.
   and ``!=`` (not equal to).
 
 * The *body* of the loop is *indented*: indentation is Python's way of grouping
-  statements.  At the interactive prompt, you have to type a tab or space(s) 
for
-  each indented line.  In practice you will prepare more complicated input
-  for Python with a text editor; all decent text editors have an auto-indent
-  facility.  When a compound statement is entered interactively, it must be
+  statements.  At the interactive prompt, the default REPL automatically
+  indents continuation lines after compound statement headers like ``if`` or
+  ``while``.  In the basic REPL (invoked with :envvar:`PYTHON_BASIC_REPL`)
+  or in older Python versions, you have to type a tab or space(s) for each
+  indented line manually.  In practice you will prepare more complicated
+  input for Python with a text editor; all decent text editors have an
+  auto-indent facility.  When a compound statement is entered interactively, 
it must be
   followed by a blank line to indicate completion (since the parser cannot
   guess when you have typed the last line).  Note that each line within a basic
   block must be indented by the same amount.

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3//lists/python-checkins.python.org
Member address: [email protected]

Reply via email to