Skip to content

Commit 95f05f8

Browse files
mvanhornclaude
andcommitted
gh-145694: Update tutorial indentation guidance for PyREPL auto-indent
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. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 66eafc9 commit 95f05f8

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

Doc/tutorial/introduction.rst

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -532,10 +532,13 @@ This example introduces several new features.
532532
and ``!=`` (not equal to).
533533

534534
* The *body* of the loop is *indented*: indentation is Python's way of grouping
535-
statements. At the interactive prompt, you have to type a tab or space(s) for
536-
each indented line. In practice you will prepare more complicated input
537-
for Python with a text editor; all decent text editors have an auto-indent
538-
facility. When a compound statement is entered interactively, it must be
535+
statements. At the interactive prompt, the default REPL automatically
536+
indents continuation lines after compound statement headers like ``if`` or
537+
``while``. In the basic REPL (invoked with :envvar:`PYTHON_BASIC_REPL`)
538+
or in older Python versions, you have to type a tab or space(s) for each
539+
indented line manually. In practice you will prepare more complicated
540+
input for Python with a text editor; all decent text editors have an
541+
auto-indent facility. When a compound statement is entered interactively, it must be
539542
followed by a blank line to indicate completion (since the parser cannot
540543
guess when you have typed the last line). Note that each line within a basic
541544
block must be indented by the same amount.

0 commit comments

Comments
 (0)