Skip to content

Commit f1f0f2e

Browse files
[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 a1332a9) Co-authored-by: Terry Jan Reedy <[email protected]>
1 parent 679fe04 commit f1f0f2e

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
@@ -1873,8 +1873,9 @@ the unpacking.
18731873

18741874
.. index:: pair: trailing; comma
18751875

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

0 commit comments

Comments
 (0)