From: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> Date: Tue, 30 Jan 2024 18:50:32 +0000 (+0100) Subject: [3.11] Clarify one-item tuple (GH-114745) (#114758) X-Git-Tag: v3.11.8~54 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f1f0f2e3d740c96edd233f4f1a1aa76cdc81bb53;p=thirdparty%2FPython%2Fcpython.git [3.11] Clarify one-item tuple (GH-114745) (#114758) A 'single tuple' means 'one tuple, of whatever length. Remove the unneeded and slightly distracting parenthetical 'singleton' comment. (cherry picked from commit a1332a99cf1eb9b879d4b1f28761b096b5749a0d) Co-authored-by: Terry Jan Reedy --- diff --git a/Doc/reference/expressions.rst b/Doc/reference/expressions.rst index 1fec404260d2..2f346fbde39e 100644 --- a/Doc/reference/expressions.rst +++ b/Doc/reference/expressions.rst @@ -1873,8 +1873,9 @@ the unpacking. .. index:: pair: trailing; comma -The trailing comma is required only to create a single tuple (a.k.a. a -*singleton*); it is optional in all other cases. A single expression without a +A trailing comma is required only to create a one-item tuple, +such as ``1,``; it is optional in all other cases. +A single expression without a trailing comma doesn't create a tuple, but rather yields the value of that expression. (To create an empty tuple, use an empty pair of parentheses: ``()``.)