Skip to content

Fix quotes in string representation of a tutorial example - #163063

Merged
picnixz merged 1 commit into
python:mainfrom
aliysnm:docs-tutorial-list-repr-quotes
Dec 3, 2026
Merged

picnixz merged 1 commit into
python:mainfrom
aliysnm:docs-tutorial-list-repr-quotes

Conversation

@aliysnm

@aliysnm aliysnm commented Dec 3, 2026 •

Copy link
Copy Markdown
Contributor

In the "Lists" section of the tutorial, the example output uses double quotes, but the interpreter prints a list's items with single quotes:

>>> rgb = ["Red", "Green", "Blue"]
>>> rgba = rgb
>>> rgba.append("Alph")
>>> rgb
['Red', 'Green', 'Blue', 'Alph']   # actual
["Red", "Green", "Blue", "Alph"]   # documented

This is a small detail, but the tutorial is aimed at beginners, who may copy the session and wonder why their output differs. The fix changes only the three output lines. The input lines keep their double quotes.

I found this the same way as #163060: by running the >>> examples in literal blocks, which the doctest builder doesn't check. I used an AI assistant to write that script and to prepare this PR. After the fix, the only remaining failure in this file is the intentional SyntaxError example.

Python shows list items with single quotes, so the output of the
rgb/rgba example in the "Lists" section of the tutorial did not match
what the interpreter prints.
@read-the-docs-community

read-the-docs-community Bot commented Dec 3, 2026 •

Copy link
Copy Markdown

📖 2 files modified


Preview · build overview · cpython-previews · built Dec. 3, 2026, 9:53 a.m. UTC

@aliysnm
aliysnm force-pushed the docs-tutorial-list-repr-quotes branch from 0c814da to 063ef89 Compare December 3, 2026 09:50
@picnixz picnixz changed the title Docs: Fix list repr quotes in tutorial example Fix quotes in string representation of a tutorial example Dec 3, 2026
@picnixz picnixz added needs backport to 3.14 bugs and security fixes needs backport to 3.15 bugs and security fixes labels Dec 3, 2026
@picnixz
picnixz enabled auto-merge (squash) December 3, 2026 13:05
@picnixz
picnixz disabled auto-merge December 3, 2026 13:05
@picnixz picnixz changed the title Fix quotes in string representation of a tutorial example Fix quotes in string representation of a tutorial example Dec 3, 2026
@picnixz
picnixz merged commit d95c6a0 into python:main Dec 3, 2026
41 checks passed
@miss-islington-app

Copy link
Copy Markdown

Thanks @aliysnm for the PR, and @picnixz for merging it 🌮🎉.. I'm working now to backport this PR to: 3.14, 3.15.
🐍🍒⛏🤖

@github-project-automation github-project-automation Bot moved this from Todo to Done in Docs PRs Dec 3, 2026
@bedevere-app

bedevere-app Bot commented Dec 3, 2026

Copy link
Copy Markdown

GH-163083 is a backport of this pull request to the 3.15 branch.

@bedevere-app bedevere-app Bot removed the needs backport to 3.15 bugs and security fixes label Dec 3, 2026
@bedevere-app

bedevere-app Bot commented Dec 3, 2026

Copy link
Copy Markdown

GH-163084 is a backport of this pull request to the 3.14 branch.

@bedevere-app bedevere-app Bot removed the needs backport to 3.14 bugs and security fixes label Dec 3, 2026
picnixz pushed a commit that referenced this pull request Dec 3, 2026
…163063) (#163084)

Fix quotes in string representation of a tutorial example (GH-163063)
(cherry picked from commit d95c6a0)

Co-authored-by: Ali <105012194+aliysnm@users.noreply.github.com>
picnixz pushed a commit that referenced this pull request Dec 3, 2026
…163063) (#163083)

Fix quotes in string representation of a tutorial example (GH-163063)
(cherry picked from commit d95c6a0)

Co-authored-by: Ali <105012194+aliysnm@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Documentation in the Doc dir skip issue skip news

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants