Skip to content

Commit b3d01fc

Browse files
[3.12] Clarify one-item tuple (GH-114745) (#114757)
A 'single tuple' means 'one tuple, of whatever length. Remove the unneeded and slightly distracting parenthetical 'singleton' comment. (cherry picked from commit a1332a9) Co-authored-by: Terry Jan Reedy <[email protected]>
1 parent 424df31 commit b3d01fc

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Doc/reference/expressions.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1883,8 +1883,9 @@ the unpacking.
18831883

18841884
.. index:: pair: trailing; comma
18851885

1886-
The trailing comma is required only to create a single tuple (a.k.a. a
1887-
*singleton*); it is optional in all other cases. A single expression without a
1886+
A trailing comma is required only to create a one-item tuple,
1887+
such as ``1,``; it is optional in all other cases.
1888+
A single expression without a
18881889
trailing comma doesn't create a tuple, but rather yields the value of that
18891890
expression. (To create an empty tuple, use an empty pair of parentheses:
18901891
``()``.)

0 commit comments

Comments
 (0)